Author: dgolovin
Date: 2007-11-02 00:39:06 -0400 (Fri, 02 Nov 2007)
New Revision: 4651
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/editor/TLDRegisterHelper.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1244
NPE fixed
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/editor/TLDRegisterHelper.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/editor/TLDRegisterHelper.java 2007-11-02
00:00:29 UTC (rev 4650)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/editor/TLDRegisterHelper.java 2007-11-02
04:39:06 UTC (rev 4651)
@@ -13,6 +13,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.text.IDocument;
import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
import org.jboss.tools.common.kb.KbTldResource;
import org.jboss.tools.common.kb.wtp.JspWtpKbConnector;
@@ -51,12 +52,16 @@
JspEditorPlugin.getPluginLog().logError(e);
return;
}
- IEditorInput input =
JspEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorInput();
- String tldContent = DropUtils.getTldContent(input, data.getUri());
- if(tldContent!=null) {
- resource.setTldContent(tldContent);
- wtpKbConnector.registerResource(resource, true);
- }
+
+ IEditorPart editorPart =
JspEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ if(editorPart!=null) {
+ IEditorInput input = editorPart.getEditorInput();
+ String tldContent = DropUtils.getTldContent(input, data.getUri());
+ if(tldContent!=null) {
+ resource.setTldContent(tldContent);
+ wtpKbConnector.registerResource(resource, true);
+ }
+ }
}
} else {
wtpKbConnector.registerResource(resource);