From 306fcf34c95c296fb9e9130df3ed837cf895e333 Mon Sep 17 00:00:00 2001 From: Sergey Vladimirov Date: Thu, 7 Jul 2011 11:04:59 +0000 Subject: [PATCH] allow bad properties parsing git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1143758 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/org/apache/poi/hwpf/model/PropertyNode.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java b/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java index 251458e3f6..187e3db188 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java @@ -57,10 +57,14 @@ public abstract class PropertyNode> implements Compar _cpStart = 0; } - if ( fcStart > fcEnd ) - throw new IllegalArgumentException( "fcStart (" + fcStart - + ") > fcEnd (" + fcEnd + ")" ); - } + if ( _cpEnd < _cpStart ) + { + _logger.log( POILogger.WARN, "A property claimed to end (" + _cpEnd + + ") before start! " + + "Resetting end to start, and hoping for the best" ); + _cpEnd = _cpStart; + } + } /** * @return The start offset of this property's text. -- 2.39.5