triggering document did not trigger an string out of bounds exception, but a corrupt/very short stylename could.
@@ -108,6 +108,11 @@ public class WordExtractor extends AbstractPOIFSExtractor {
* what style should be applied to it.
*/
public static TagAndStyle buildParagraphTagAndStyle(String styleName, boolean isTable) {
+
+ if (styleName == null || styleName.trim().length() < 2) {
+ return defaultParagraphStyle;
+ }
+
TagAndStyle tagAndStyle = fixedParagraphStyles.get(styleName);
if (tagAndStyle != null) {
return tagAndStyle;
