diff options
author | Dani Megert | 2017-11-14 13:55:20 +0000 |
---|---|---|
committer | Dani Megert | 2017-11-14 13:55:20 +0000 |
commit | fb8e522613eed2b166fb1d5767fc8d08ad70c692 (patch) | |
tree | 0a70ea6976d35352a1382bf445da1772c990a063 | |
parent | 8127b32ac942fb77fe4edda6ef5e1a982ec1c04a (diff) | |
download | eclipse.platform.text-fb8e522613eed2b166fb1d5767fc8d08ad70c692.tar.gz eclipse.platform.text-fb8e522613eed2b166fb1d5767fc8d08ad70c692.tar.xz eclipse.platform.text-fb8e522613eed2b166fb1d5767fc8d08ad70c692.zip |
Fixed bug 518997: [implementation] NPE in HTML2TextReader.finishAndReinitializeCurrentStyle
-rw-r--r-- | org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTML2TextReader.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTML2TextReader.java b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTML2TextReader.java index c85cc86f083..73dec0d268a 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTML2TextReader.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTML2TextReader.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -155,7 +155,7 @@ public class HTML2TextReader extends SubstitutionTextReader { } private void finishAndReinitializeCurrentStyle(int offset) { - if (offset != fCurrentStyleRange.start && !isDefaultStyleRange(fCurrentStyleRange)) { + if (fTextPresentation != null && offset != fCurrentStyleRange.start && !isDefaultStyleRange(fCurrentStyleRange)) { fCurrentStyleRange.length= offset - fCurrentStyleRange.start; fTextPresentation.addStyleRange(fCurrentStyleRange); } |