[320370] Moving a JavaScript function in the HTML Outline View causes a null pointer exception.
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/DragNodeCommand.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/DragNodeCommand.java
index ffc9a29..736fc55 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/DragNodeCommand.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/DragNodeCommand.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2001, 2009 IBM Corporation and others.
+ * Copyright (c) 2001, 2010 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
@@ -182,7 +182,7 @@
for (Iterator i = sourcesList.iterator(); i.hasNext();) {
Object source = i.next();
if (source instanceof Node) {
- if (!((refChild == null) && (targetNode instanceof Attr))) {
+ if (!((refChild == null) && (targetNode instanceof Attr)) && (parentNode != null)) {
result = doModify((Node) source, parentNode, refChild, testOnly);
}
else {