https://bz.apache.org/bugzilla/show_bug.cgi?id=58552

            Bug ID: 58552
           Summary: NPE at XWPFStyles.getUsedStyleList()
           Product: POI
           Version: 3.11-FINAL
          Hardware: PC
            Status: NEW
          Severity: critical
          Priority: P2
         Component: XWPF
          Assignee: [email protected]
          Reporter: [email protected]

I tried to find used styles of style, which have 'next style', but has no 'link
style', using XWPFStyles.getUsedStyleList(XWPFStyle) method and got NPE at 174
line. 

https://github.com/apache/poi/blob/REL_3_11_BRANCH/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFStyles.java#L191

This part of code looks really suspicious:

        String nextStyleID = style.getNextStyleID();
        XWPFStyle nextStyle = getStyle(nextStyleID);
        if((nextStyle!=null)&&(!usedStyleList.contains(nextStyle))){
            usedStyleList.add(linkStyle);
            getUsedStyleList(linkStyle, usedStyleList);
        }    

Probably this is a bug, and author mentioned that:

usedStyleList.add(nextStyle);
getUsedStyleList(nextStyle, usedStyleList);

So, trunk version of this class contains same part of code too.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to