[229694] NPE when editing namespace of XML Document
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditNamespaceInfoDialog.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditNamespaceInfoDialog.java
index 8aabf5c..14e832d 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditNamespaceInfoDialog.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditNamespaceInfoDialog.java
@@ -226,14 +226,20 @@
 			}
 
 
-			CMDocument document = ContentModelManager.getInstance().createCMDocument(grammarURI, "xsd"); //$NON-NLS-1$
-			List namespaceInfoList = (List) document.getProperty("http://org.eclipse.wst/cm/properties/namespaceInfo"); //$NON-NLS-1$
-			NamespaceInfo info = (NamespaceInfo) namespaceInfoList.get(0);
-			if ((uriField.getText().trim().length() == 0) && (info.uri != null)) {
-				uriField.setText(info.uri);
-			}
-			if ((prefixField.getText().trim().length() == 0) && (info.prefix != null)) {
-				prefixField.setText(info.prefix);
+			CMDocument document = ContentModelManager.getInstance().createCMDocument(URIHelper.getURIForFilePath(grammarURI), "xsd"); //$NON-NLS-1$
+			if(document != null) {
+				List namespaceInfoList = (List) document.getProperty("http://org.eclipse.wst/cm/properties/namespaceInfo"); //$NON-NLS-1$
+				if(namespaceInfoList != null) {
+					NamespaceInfo info = (NamespaceInfo) namespaceInfoList.get(0);
+					if(info != null) {
+						if ((uriField.getText().trim().length() == 0) && (info.uri != null)) {
+							uriField.setText(info.uri);
+						}
+						if ((prefixField.getText().trim().length() == 0) && (info.prefix != null)) {
+							prefixField.setText(info.prefix);
+						}
+					}
+				}
 			}
 		}
 	}