--- 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;