7099251: javax.swing.text.html.HTMLDocument.insertAfterStart(null, something) throws NPE
Reviewed-by: rupashka
This commit is contained in:
parent
6fb68448cc
commit
224bf60e30
@ -1181,7 +1181,12 @@ public class HTMLDocument extends DefaultStyledDocument {
|
|||||||
public void insertAfterStart(Element elem, String htmlText) throws
|
public void insertAfterStart(Element elem, String htmlText) throws
|
||||||
BadLocationException, IOException {
|
BadLocationException, IOException {
|
||||||
verifyParser();
|
verifyParser();
|
||||||
if (elem != null && elem.isLeaf()) {
|
|
||||||
|
if (elem == null || htmlText == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (elem.isLeaf()) {
|
||||||
throw new IllegalArgumentException
|
throw new IllegalArgumentException
|
||||||
("Can not insert HTML after start of a leaf");
|
("Can not insert HTML after start of a leaf");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user