From 4a0c0f2898251f079d6127ea8359e6aec0aa5bfe Mon Sep 17 00:00:00 2001 From: Sergey Vladimirov Date: Sun, 10 Jul 2011 12:59:28 +0000 Subject: [PATCH] NP check git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1144853 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/org/apache/poi/hwpf/model/OldCHPBinTable.java | 9 +++++---- .../src/org/apache/poi/hwpf/model/OldPAPBinTable.java | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/OldCHPBinTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/OldCHPBinTable.java index 6fe191fb8..c1f25dbb3 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/OldCHPBinTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/OldCHPBinTable.java @@ -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" ); } } } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/OldPAPBinTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/OldPAPBinTable.java index 0331b997e..3cc096455 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/OldPAPBinTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/OldPAPBinTable.java @@ -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" ); } } }