Bug 52190 - [PATCH] XWPFRun.setFontFamily fails if called first when setting run properties
Summary: [PATCH] XWPFRun.setFontFamily fails if called first when setting run properties
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XWPF (show other bugs)
Version: 3.8-dev
Hardware: Macintosh All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-16 01:23 UTC by Gregg Morris
Modified: 2011-11-16 10:33 UTC (History)
0 users



Attachments
SVN patch file in plain text. (625 bytes, text/plain)
2011-11-16 01:23 UTC, Gregg Morris
Details

Note You need to log in before you can comment on or make changes to this bug.
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.