diff options
author | kchong | 2008-05-28 19:54:05 +0000 |
---|---|---|
committer | kchong | 2008-05-28 19:54:05 +0000 |
commit | 3435832726cadeef878e1bd15d78db101535957f (patch) | |
tree | d122a6855879aa46c940ac8f1cb782315c7d192c /bundles/org.eclipse.wst.xml.ui | |
parent | 6478ec3d57600a8a78ba195dc9888d82c218d8c8 (diff) | |
download | webtools.sourceediting-3435832726cadeef878e1bd15d78db101535957f.tar.gz webtools.sourceediting-3435832726cadeef878e1bd15d78db101535957f.tar.xz webtools.sourceediting-3435832726cadeef878e1bd15d78db101535957f.zip |
[229694] NPE when editing namespace of XML Document
Diffstat (limited to 'bundles/org.eclipse.wst.xml.ui')
-rw-r--r-- | bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditNamespaceInfoDialog.java | 22 |
1 files changed, 14 insertions, 8 deletions
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 8aabf5c766..14e832d369 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 @@ public class EditNamespaceInfoDialog extends Dialog { } - 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); + } + } + } } } } |