woproject/projects/wolips/plugins/org.objectstyle.wolips.componenteditor/java/org/objectstyle/wolips/componenteditor/editor ComponentEditorMatchingStrategy.java,1.3,1.4

[email protected]
Newsgroups gmane.comp.web.webobjects.woproject.cvs
Message-ID <[email protected]>
Update of /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips.componenteditor/java/org/objectstyle/wolips/componenteditor/editor
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27980/java/org/objectstyle/wolips/componenteditor/editor

Modified Files:
	ComponentEditorMatchingStrategy.java 
Log Message:
Avoid npe when editor was not restored. Restore it on the fly.

Index: ComponentEditorMatchingStrategy.java
===================================================================
RCS file: /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips.componenteditor/java/org/objectstyle/wolips/componenteditor/editor/ComponentEditorMatchingStrategy.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ComponentEditorMatchingStrategy.java	6 Jan 2006 12:42:40 -0000	1.3
+++ ComponentEditorMatchingStrategy.java	13 Jan 2006 11:09:51 -0000	1.4
@@ -47,7 +47,7 @@
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorMatchingStrategy;
 import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.ide.ResourceUtil;
 import org.eclipse.ui.part.FileEditorInput;
 import org.objectstyle.wolips.componenteditor.ComponenteditorPlugin;
@@ -85,7 +85,11 @@
 		}
 //		IEditorInput editorReferenceEditorInput = null;
 		//expensive: call it as late as possible
-		ComponentEditorInput componentEditorInput = ((ComponentEditorPart)editorReference.getPart(false)).componentEditorInput;
+		IWorkbenchPart workbenchPart = editorReference.getPart(true);
+		if(workbenchPart == null) {
+			return false;
+		}
+		ComponentEditorInput componentEditorInput = ((ComponentEditorPart)workbenchPart).componentEditorInput;
 //		if(editorReferenceEditorInput == null) {
 //			return false;
 //		}



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.