From 27ece8b0480048de716c740f5ef6222aa482c9f1 Mon Sep 17 00:00:00 2001 From: Maxim Valyanskiy Date: Tue, 27 Mar 2012 11:14:47 +0000 Subject: [PATCH] HWPF: fix NPE when reading paragraph properties git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1305810 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/org/apache/poi/hwpf/converter/AbstractWordUtils.java | 2 +- src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java b/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java index 02c79665fe..710ca2453d 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java @@ -232,7 +232,7 @@ public class AbstractWordUtils final ListLevel listLevel = listTables.getLevel( listId, paragraph.getIlvl() ); - if ( listLevel.getNumberText() == null ) + if ( listLevel==null || listLevel.getNumberText() == null ) return EMPTY; StringBuffer bulletBuffer = new StringBuffer(); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java index 11e91fa5e2..6d99465abc 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java @@ -110,7 +110,7 @@ public class Paragraph extends Range implements Cloneable { final ListLevel listLevel = listTables.getLevel( listFormatOverride.getLsid(), properties.getIlvl() ); - if ( listLevel.getGrpprlPapx() != null ) + if ( listLevel!=null && listLevel.getGrpprlPapx() != null ) { properties = ParagraphSprmUncompressor.uncompressPAP( properties, listLevel.getGrpprlPapx(), 0 ); -- 2.39.5