Bug 62859

Summary: NPE when creating SDTContent
Product: POI Reporter: Tim Allison <tallison>
Component: XWPFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description Tim Allison 2018-10-26 17:39:25 UTC
Иван Сорокин reported the following NPE on discuss.elastic.co.  I can't quick replicate it, but I can see how to fix it.

https://discuss.elastic.co/t/error-while-using-ingest-attachment-plugin-on-some-docs/153836/2

Caused by: java.lang.NullPointerException
>       at org.apache.poi.xwpf.usermodel.XWPFSDTContent.<init>(XWPFSDTContent.java:50) ~[?:?]
>       at org.apache.poi.xwpf.usermodel.XWPFSDT.<init>(XWPFSDT.java:34) ~[?:?]
>       at org.apache.poi.xwpf.usermodel.XWPFParagraph.buildRunsInOrderFromXml(XWPFParagraph.java:136) ~[?:?]
>       at org.apache.poi.xwpf.usermodel.XWPFParagraph.<init>(XWPFParagraph.java:63) ~[?:?]
>       at org.apache.poi.xwpf.usermodel.XWPFSDTContent.<init>(XWPFSDTContent.java:63) ~[?:?]
>       at org.apache.poi.xwpf.usermodel.XWPFSDT.<init>(XWPFSDT.java:39) ~[?:?]
>       at org.apache.poi.xwpf.usermodel.XWPFDocument.onDocumentRead(XWPFDocument.java:178) ~[?:?]
>       at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:169) ~[?:?]
>       at org.apache.poi.xwpf.usermodel.XWPFDocument.<init>(XWPFDocument.java:112) ~[?:?]
>       at org.apache.poi.xwpf.extractor.XWPFWordExtractor.<init>(XWPFWordExtractor.java:60) ~[?:?]

Full stacktrace is here:
https://pastebin.com/CHfFMc52
Comment 1 Tim Allison 2018-10-26 17:52:28 UTC
_quickly_

Once local integration tests pass, I'll commit the fix.
Comment 2 Tim Allison 2018-10-26 19:10:40 UTC
r1844920