# HG changeset patch # User vadim # Date 1444759159 -10800 # Node ID 6dc8e176c81e907e5428dfe40e0ec168b3914580 # Parent c8e399b7825bc992bd8942fe349344c06b087e2a 8132988: Better printing dialogues Reviewed-by: prr, serb, mschoene diff -r c8e399b7825b -r 6dc8e176c81e 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;