]> source.dussan.org Git - poi.git/commitdiff
HWPF: fix NPE when reading paragraph properties
authorMaxim Valyanskiy <maxcom@apache.org>
Tue, 27 Mar 2012 11:14:47 +0000 (11:14 +0000)
committerMaxim Valyanskiy <maxcom@apache.org>
Tue, 27 Mar 2012 11:14:47 +0000 (11:14 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1305810 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java
src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java

index 02c79665fe04604d5a30944d74eb7d8509f3626c..710ca2453d5f20c8bf794afce10b07208001bec5 100644 (file)
@@ -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();
index 11e91fa5e23ae22c130b1d232cf416207e61fb02..6d99465abcdb34dfb76b17b926718241bf9f3a93 100644 (file)
@@ -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 );