Null reference exception

I am using the PdfViewer control within a MahApps / MaterialDesign in XAML application. I turned off the toolbar in the WPF control and was just checking out the view before implementing further functionality.

The application crashed on a NullReference exception in CustomVPanel.cs, CustomVPanel_MouseLeftButtonUp.

The very last switch case (for "FitH"):

Snippet
if (pdfArray2.Elements.Count > 2)
{
	x = (pdfArray2.Elements[2] as PdfNumber).FloatValue;
}

The pdfArray2 has 5 elements, but elements 2, 3, and 4 are all PdfNull - which as you can see from the code above will not work.


1 Reply

PR Padmini Ramamurthy Syncfusion Team November 27, 2023 02:29 PM UTC

Hi Arvind,


We have created a ticket for this issue under your account, and you can follow it for further updates.


Regards,

Padmini




Loader.
Up arrow icon