|PDFsharp & MigraDoc Foundation
|Exception in PdfPage.HasAnnotations when no annotations on p
|Page 1 of 1|
|Author:||PeterEm [ Fri Sep 08, 2017 9:12 pm ]|
|Post subject:||Exception in PdfPage.HasAnnotations when no annotations on p|
This is from https://github.com/empira/PDFsharp/ which I just pulled down today. In PdfPage.cs line 383
The code throws an exception if the page does not have annotations because it tries to assign `this` when it have already established that _annotations is null, and GetValue doesn't create a new object.
public bool HasAnnotations
if (_annotations == null)
// Get annotations array if exists.
_annotations = (PdfAnnotations)Elements.GetValue(Keys.Annots);
_annotations.Page = this;
return _annotations != null;
|Page 1 of 1||All times are UTC|
|Powered by phpBB® Forum Software © phpBB Group