Bug 52190

Summary: [PATCH] XWPFRun.setFontFamily fails if called first when setting run properties
Product: POI Reporter: Gregg Morris <gregg.morris>
Component: XWPFAssignee: POI Developers List <dev>
Severity: normal    
Priority: P2    
Version: 3.8-dev   
Target Milestone: ---   
Hardware: Macintosh   
OS: All   
Attachments: SVN patch file in plain text.

Description Gregg Morris 2011-11-16 01:23:31 UTC
Created attachment 27945 [details]
SVN patch file in plain text.

XWPFRun.setFontFamily doesn't check for the existence of the Run's CTRPr member. If setFontFamily is called before any other method that sets a run property, it will throw a NullPointerException. My solution was to use the same test/creation logic as is used in other methods that set a run property. If the run property doesn't exist, it will be created and the font family set.
Comment 1 Nick Burch 2011-11-16 10:33:19 UTC
Thanks, applied in r1202620.