Author: yradtsevich
Date: 2009-06-08 03:38:51 -0400 (Mon, 08 Jun 2009)
New Revision: 15766
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
NPE fixed.
https://jira.jboss.org/jira/browse/JBIDE-4142
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2009-06-08
05:56:25 UTC (rev 15765)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2009-06-08
07:38:51 UTC (rev 15766)
@@ -1697,10 +1697,20 @@
new VpeSourceInnerDragInfo(dragNode, 0, 0),
new VpeSourceInnerDropInfo(container, offset, true));
} else {
- ((VpeElementMapping) oldMapping).getTemplate().innerDrop(
- pageContext,
- new VpeSourceInnerDragInfo(dragNode, 0, 0),
- new VpeSourceInnerDropInfo(container, offset, true));
+ if (oldMapping instanceof VpeElementMapping) {
+ ((VpeElementMapping) oldMapping).getTemplate().innerDrop(
+ pageContext,
+ new VpeSourceInnerDragInfo(dragNode, 0, 0),
+ new VpeSourceInnerDropInfo(container, offset, true));
+ } else {
+ /* TODO: implement this case or completely
+ * remove this method?
+ * At the time of writing this comment
+ * the implementation of template.innerDrop() method above
+ * was empty, so there are no differences between
+ * calling this method and doing nothing.
+ */
+ }
}
// }