[jbosstools-commits] JBoss Tools SVN: r17602 - trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/factory.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Tue Sep 15 19:34:00 EDT 2009


Author: dgolovin
Date: 2009-09-15 19:34:00 -0400 (Tue, 15 Sep 2009)
New Revision: 17602

Modified:
   trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/factory/AdapterFactory.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4890 NPE was fixed

Modified: trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/factory/AdapterFactory.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/factory/AdapterFactory.java	2009-09-15 20:34:26 UTC (rev 17601)
+++ trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/factory/AdapterFactory.java	2009-09-15 23:34:00 UTC (rev 17602)
@@ -132,11 +132,15 @@
 	IResource adapt_Element2IResource ( Element elm ) {
 		
 		Element top = elm.getOwnerDocument().getDocumentElement();
-		
-		// Find the EObject reference to the emf model in the hierarchy of the 
-		EObject eObj = (EObject) top.getUserData("emf.model");
-		
-		return adapt_EObject2IResource(eObj);
+		IResource result = null;
+		if (top != null) {
+			// Find the EObject reference to the emf model in the hierarchy of
+			// the
+			EObject eObj = (EObject) top.getUserData("emf.model");
+
+			result = adapt_EObject2IResource(eObj);
+		}
+		return result;
 	}
 
 	/**



More information about the jbosstools-commits mailing list