Details
Description
The problem is that the toString method is called on objects which may have been returned as null
The suggested fix to this, in the attached patch is to check if null, then write an empty string
String s = "Shading " + shadingname + "\n"
+ "\tShadingType: " + getShadingType() + "\n"
+ "\tColorSpace: " + sColorSpace + "\n"
+ "\tAntiAlias: " + getAntiAlias() + "\n"
+ "\tCoords: " + (getCoords() != null ? getCoords().toString() : "") + "\n"
+ "\tDomain: " + (getDomain() != null ? getDomain().toString() : "") + "\n"
+ "\tFunction: " + sFunction + "\n"
+ "\tExtend: " + (getExtend() != null ? getExtend().toString() : "") + "\n"
+ "\tRaw Value:\n" +
<Error message as dumped to log>
INFO [main] (PDFStreamEngine.java557) - unsupported/disabled operation: BDC
INFO [main] (PDFStreamEngine.java557) - unsupported/disabled operation: BX
WARN [main] (SHFill.java63) - java.lang.NullPointerException
java.lang.NullPointerException
at org.apache.pdfbox.pdmodel.graphics.PDShading.toString(PDShading.java:204)
at org.apache.pdfbox.pdfviewer.PageDrawer.SHFill(PageDrawer.java:398)
at org.apache.pdfbox.util.operator.pagedrawer.SHFill.process(SHFill.java:58)
at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:551)
at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:274)
at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:251)
at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:225)
at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:107)
at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:722)
INFO [main] (PDFStreamEngine.java557) - unsupported/disabled operation: EX
INFO [main] (PDFStreamEngine.java557) - unsupported/disabled operation: EMC
</Error message as dumped to log>