Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Commit

Permalink
🐛 PDF: Fix NPE for legitimate documents
Browse files Browse the repository at this point in the history
This was a sad story, that could have been prevented with tests. JUST
SAYIN', dear me!
  • Loading branch information
punkeel committed Apr 27, 2017
1 parent 0c3eb66 commit 7e70a69
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ private void sanitize(ScratchFile scratchFile, RandomAccessRead source, OutputSt
}

private void sanitizeNamed(BleachSession session, PDDocument doc, PDDocumentNameDictionary names) {
if (names == null)
return;

sanitizeRecursiveNameTree(names.getEmbeddedFiles(), fileSpec -> sanitizeEmbeddedFile(session, doc, fileSpec));

sanitizeRecursiveNameTree(names.getJavaScript(), action -> sanitizeJavascript(session, doc, action));
Expand Down

0 comments on commit 7e70a69

Please sign in to comment.