Skip to content

Commit 8145e7b

Browse files
committed
Fixed a casting where the types were incompatible. Out of spec pdf fix.
1 parent 3f5e669 commit 8145e7b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/PdfSharp/Pdf/PdfDictionary.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,8 +652,10 @@ public PdfRectangle GetRectangle(string key, bool create)
652652
array.Elements.GetReal(2), array.Elements.GetReal(3));
653653
this[key] = value;
654654
}
655-
else
656-
value = (PdfRectangle)obj;
655+
else if (obj is PdfRectangle rectangle)
656+
{
657+
value = rectangle;
658+
}
657659
return value;
658660
}
659661

0 commit comments

Comments
 (0)