[458779] NPE thrown by org.eclipse.wst.html.core.internal.format.HTMLTextFormatter.isWordInComplexRegion() when text.getFirstStructuredDocumentRegion() returns null Signed-off-by: Alina Marin <alina@mx1.ibm.com>
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLTextFormatter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLTextFormatter.java index 0332418..45725ad 100644 --- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLTextFormatter.java +++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLTextFormatter.java
@@ -318,6 +318,9 @@ } private boolean isWordInComplexRegion(SpaceConverter converter, IDOMText text) { + if (textRegion == null) { + return false; + } final int offset = text.getFirstStructuredDocumentRegion().getStartOffset(); while (textRegion != null && (converter.getWordOffset() + offset >= textRegion.getEnd()) && textRegion != text.getLastStructuredDocumentRegion()) { textRegion = textRegion.getNext();