]> source.dussan.org Git - poi.git/commitdiff
NP check
authorSergey Vladimirov <sergey@apache.org>
Sun, 10 Jul 2011 12:59:28 +0000 (12:59 +0000)
committerSergey Vladimirov <sergey@apache.org>
Sun, 10 Jul 2011 12:59:28 +0000 (12:59 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1144853 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hwpf/model/OldCHPBinTable.java
src/scratchpad/src/org/apache/poi/hwpf/model/OldPAPBinTable.java

index 6fe191fb84324e03ebc91bda15455c62dd51f546..c1f25dbb37ff62678fc09d6b25c380b6db5634b0 100644 (file)
@@ -70,10 +70,11 @@ public final class OldCHPBinTable extends CHPBinTable
         if (chpx != null && tpt.isIndexInTable( chpx.getStartBytes(), chpx.getEndBytes() )) {
             _textRuns.add(chpx);
         } else {
-                    logger.log( POILogger.WARN, "CHPX [",
-                            chpx.getStartBytes(), "; ", chpx.getEndBytes(),
-                            ") (bytes) doesn't have corresponding text pieces "
-                                    + "and will be skipped" );
+                    if ( chpx != null )
+                        logger.log( POILogger.WARN, "CHPX [",
+                                chpx.getStartBytes(), "; ", chpx.getEndBytes(),
+                                ") (bytes) doesn't have corresponding text pieces "
+                                        + "and will be skipped" );
         }
       }
     }
index 0331b997e43569a86b022ce9b63a9ea7255ff6b9..3cc096455eaa29b3edf2085afc91f3e46ffecd26 100644 (file)
@@ -61,10 +61,11 @@ public final class OldPAPBinTable extends PAPBinTable
         if (papx != null && tpt.isIndexInTable( papx.getStartBytes(), papx.getEndBytes() )) {
             _paragraphs.add(papx);
         } else {
-            logger.log( POILogger.WARN, "PAPX [", papx.getStartBytes(),
-                    "; ", papx.getEndBytes(),
-                    ") (bytes) doesn't have corresponding text pieces "
-                            + "and will be skipped" );
+                    if ( papx != null )
+                        logger.log( POILogger.WARN, "PAPX [",
+                                papx.getStartBytes(), "; ", papx.getEndBytes(),
+                                ") (bytes) doesn't have corresponding text pieces "
+                                        + "and will be skipped" );
         }
       }
     }