8221411: NullPointerException in RasterPrinterJob without PrinterResolution

Reviewed-by: prr
This commit is contained in:
Prasanta Sadhukhan 2019-03-28 13:49:27 +05:30
parent 3642a0007f
commit 21e9b4d59f

View File

@ -1275,10 +1275,12 @@ public abstract class RasterPrinterJob extends PrinterJob {
printerResAttr = (PrinterResolution)
service.getDefaultAttributeValue(PrinterResolution.class);
}
double xr =
printerResAttr.getCrossFeedResolution(ResolutionSyntax.DPI);
double yr = printerResAttr.getFeedResolution(ResolutionSyntax.DPI);
setXYRes(xr, yr);
if (printerResAttr != null) {
double xr =
printerResAttr.getCrossFeedResolution(ResolutionSyntax.DPI);
double yr = printerResAttr.getFeedResolution(ResolutionSyntax.DPI);
setXYRes(xr, yr);
}
}
pageRangesAttr = (PageRanges)attributes.get(PageRanges.class);