diff --git a/platform/util/src/com/intellij/openapi/util/TextRange.java b/platform/util/src/com/intellij/openapi/util/TextRange.java index e3cfceb31e35..e051f77ed66f 100644 --- a/platform/util/src/com/intellij/openapi/util/TextRange.java +++ b/platform/util/src/com/intellij/openapi/util/TextRange.java @@ -218,11 +218,8 @@ public class TextRange implements Segment, Serializable { } public static void assertProperRange(int startOffset, int endOffset, @NotNull Object message) { - if (startOffset > endOffset) { + if (startOffset > endOffset || startOffset < 0) { LOG.error("Invalid range specified: (" + startOffset + "," + endOffset + "); " + message); } - if (startOffset < 0) { - LOG.error("Negative start offset: (" + startOffset + "," + endOffset + "); " + message); - } } }