8132988: Better printing dialogues
authorvadim
Tue, 13 Oct 2015 20:59:19 +0300
changeset 35286 6dc8e176c81e
parent 35285 c8e399b7825b
child 35287 e59d934ce2ba
8132988: Better printing dialogues Reviewed-by: prr, serb, mschoene
jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java
--- 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;