Closed prettybits closed 1 year ago
Base: 46.22% // Head: 46.22% // No change to project coverage :thumbsup:
Coverage data is based on head (
f0b79d1
) compared to base (b54fa00
). Patch has no changes to coverable lines.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
This doesn't create any issues and is a belt and braces catch for a fix submitted by @samalloing. I'm going to merge it all the same, the code base is too casual in its treatment of nulls.
Thanks for merging, I just saw there was also #820 that is effectively concerned with the same issue this PR also fixes. With this merged the added null check there in addStringProperty
should actually not even be needed now, but for sure doesn't hurt. In any case, the affected PDFs validate all the same now. :)
Related to #668, a null-pointer exception is thrown when adding string properties from docInfo in
readDocInfoDict
when the token values are an empty hex string. The parser only sets the value of aLiteral
's underlyingStringValuedToken
when there are other tokens between<
and>
, so empty hex strings result in the token's_value
beingnull
, whileProperty
expects an actual string.This either needs to more stringent checking for
null
at the relevant call sites or just initializing the_value
as an empty string forStringValuedToken
. AFAICS this should pose no issues, does it? @carlwilson