NullReferenceException in InputPdf.Dispose

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Rasterizer for .NET (v3)  /  NullReferenceException in InputPdf.Dispose

DynamicPDF Rasterizer for .NET (v3) Forum

Just encountered a scenario where an attempt to try and create an `InputPdf` with a zero length byte array caused a crash. I've added an error handler catching `ceTe.DynamicPDF.Rasterizer.DocumentLoadException` so now I can handle it but my program is still crashing and takes down the whole app with it. It seems like there's a `NullReferenceException` that is occurring in the finalizer of the `InputPdf`.

This will reproduce the error

var bytes = new byte[0];
try
{
        using (var pdf = new ceTe.DynamicPDF.Rasterizer.InputPdf(bytes))
        {
                new ceTe.DynamicPDF.Rasterizer.PdfRasterizer(pdf, 1, 1); //This never hits
        }
}
catch(ceTe.DynamicPDF.Rasterizer.DocumentLoadException)
{
        //handle error trying to load the file
}
Posted by a ceTe Software moderator
Hello,

Can you please send over the following information to support@dynamicpdf.com  so we can look into it further?

1.        Full error message along with stack trace.
2.        Exact version and build number of the DynamicPDF Rasterizer DLL file used in the application. You can get this information  by right clicking on the DynamicPDF Rasterizer DLL file>>Properties>>Details tab>>Product version. Take a screenshot of the Details tab and send it over to us.

Also please include the forum link in your email.

Thanks,
ceTe Software Support Team
Posted by a ceTe Software moderator
Hello,

This issue has been fixed. You can download the latest DynamicPDF Rasterizer version (v3.06+) which includes the fix from NuGet (Product ID: ceTe.DynamicPDF.Rasterizer.NET) here or from our website here.

Thanks,
ceTe Software Support Team

All times are US Eastern Standard time. The time now is 11:17 PM.