Skip to content

Commit

Permalink
Fix npe from old docs (#5218)
Browse files Browse the repository at this point in the history
  • Loading branch information
kbirk authored Oct 21, 2024
1 parent df9d1f3 commit 6bd0739
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@ public DocumentAsset applyExtractPDFResponse(
document.setText(extractionResponse.textExtraction.documentText);
}

if (document.getExtractions() == null) {
document.setExtractions(new ArrayList<>());
}

for (final String page : extractionResponse.textExtraction.documentTextPerPage) {
final ExtractedDocumentPage p = new ExtractedDocumentPage();
p.setText(page);
Expand Down

0 comments on commit 6bd0739

Please sign in to comment.