float[] functionResult = function.eval(functionValues);

eval is an abstract method, but I don't see how any of its implementation would return null :-(   (but I just woke up)

oh wait, there's this:

        if (functionsArray.length == 1)
        {
            // This doesn't make sense but it may happen ...
            function = functionsArray[0];
            PDRange encRange = getEncodeForParameter(0);
            x = interpolate(x, domain.getMin(), domain.getMax(), encRange.getMin(), encRange.getMax());
        }

function has a null check, but in the else part only

Tilman

Am 14.06.2022 um 21:35 schrieb John Lussmyer:
We are using PDFBox to render various PDF files in our product.
One customer is having issues due to PDFBox throwing a NullPointerException 
when certain files are rendered. (No, I don't have copies of the files - yet)
Any ideas on what could cause this?

java.lang.NullPointerException: null
     at 
org.apache.pdfbox.pdmodel.common.function.PDFunctionType3.eval(PDFunctionType3.java:123)
 ~[pdfbox.jar:?]
     at 
org.apache.pdfbox.pdmodel.graphics.shading.PDShading.evalFunction(PDShading.java:410)
 ~[pdfbox.jar:?]
     at 
org.apache.pdfbox.pdmodel.graphics.shading.PDShading.evalFunction(PDShading.java:393)
 ~[pdfbox.jar:?]
     at 
org.apache.pdfbox.pdmodel.graphics.shading.AxialShadingContext.calcColorTable(AxialShadingContext.java:151)
 ~[pdfbox.jar:?]
     at 
org.apache.pdfbox.pdmodel.graphics.shading.AxialShadingContext.<init>(AxialShadingContext.java:128)
 ~[pdfbox.jar:?]
     at 
org.apache.pdfbox.pdmodel.graphics.shading.AxialShadingPaint.createContext(AxialShadingPaint.java:62)
 ~[pdfbox.jar:?]
     at sun.java2d.pipe.AlphaPaintPipe.startSequence(Unknown Source) ~[?:?]
     at sun.java2d.pipe.SpanShapeRenderer$Composite.startSequence(Unknown 
Source) ~[?:?]
     at sun.java2d.pipe.SpanShapeRenderer.renderSpans(Unknown Source) ~[?:?]
     at sun.java2d.pipe.SpanShapeRenderer.fill(Unknown Source) ~[?:?]
     at sun.java2d.pipe.ValidatePipe.fill(Unknown Source) ~[?:?]
     at sun.java2d.SunGraphics2D.fill(Unknown Source) ~[?:?]
     at 
org.apache.pdfbox.rendering.PageDrawer.shadingFill(PageDrawer.java:1234) 
~[pdfbox.jar:?]
....


I believe the version we are using is the 3.0.0-alpha2.

Confidentiality notice: This message may contain confidential information. It 
is intended only for the person to whom it is addressed. If you are not that 
person, you should not use this message. We request that you notify us by 
replying to this message, and then delete all copies including any contained in 
your reply. Thank you.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org

Reply via email to