changeset 35286:6dc8e176c81e

8132988: Better printing dialogues Reviewed-by: prr, serb, mschoene
author vadim
date Tue, 13 Oct 2015 20:59:19 +0300
parents c8e399b7825b
children e59d934ce2ba
files jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java	Wed Oct 07 18:04:06 2015 +0100
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java	Tue Oct 13 20:59:19 2015 +0300
@@ -235,6 +235,11 @@
         // this will not work if the user clicks on the "Preview" button
         // However if the printer is a StreamPrintService, its the right path.
         PrintService psvc = getPrintService();
+
+        if (psvc == null) {
+            throw new PrinterException("No print service found.");
+        }
+
         if (psvc instanceof StreamPrintService) {
             spoolToService(psvc, attributes);
             return;