Author: dgolovin
Date: 2011-11-04 14:06:36 -0400 (Fri, 04 Nov 2011)
New Revision: 36177
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
Log:
fix for null pointer exception in VPE
java.lang.NullPointerException
at org.jboss.tools.vpe.xulrunner.util.XPCOM.queryInterface(XPCOM.java:90)
at
org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor.getElementForNode(XulRunnerEditor.java:456)
at
org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor.prepareFlasherData(XulRunnerEditor.java:412)
at
org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor.redrawSelectionRectangle(XulRunnerEditor.java:406)
at org.jboss.tools.vpe.editor.VpeController$7.run(VpeController.java:2019)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
... 22 more
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2011-11-04
17:01:13 UTC (rev 36176)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2011-11-04
18:06:36 UTC (rev 36177)
@@ -452,7 +452,7 @@
if (node != null) {
if (node.getNodeType() == nsIDOMNode.ELEMENT_NODE) {
return XPCOM.queryInterface(node, nsIDOMElement.class);
- } else if (node.getNodeType() == nsIDOMNode.TEXT_NODE) {
+ } else if (node.getNodeType() == nsIDOMNode.TEXT_NODE && node.getParentNode()
!= null) {
return XPCOM.queryInterface(node.getParentNode(), nsIDOMElement.class);
}
}