bug 1469012, exception in CompletionProposal
authorbananeweizen <bananeweizen>
Sun, 23 Apr 2006 14:39:29 +0000 (14:39 +0000)
committerbananeweizen <bananeweizen>
Sun, 23 Apr 2006 14:39:29 +0000 (14:39 +0000)
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCompletionProcessor.java

index 2046d7c..cce63ca 100644 (file)
@@ -68,6 +68,7 @@ import org.eclipse.jface.text.contentassist.IContextInformationValidator;
 import org.eclipse.jface.text.templates.TemplateContextType;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.Point;
+import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IFileEditorInput;
 
@@ -484,8 +485,14 @@ public class PHPCompletionProcessor implements IContentAssistProcessor {
                        PHPEditor editor = null;
                        if (fEditor != null && (fEditor instanceof PHPEditor)) {
                                editor = (PHPEditor) fEditor;
-                               file = ((IFileEditorInput) editor.getEditorInput()).getFile();
-                               project = file.getProject();
+                               IEditorInput editorInput=editor.getEditorInput();
+                               if (editorInput instanceof IFileEditorInput) {
+                                       file = ((IFileEditorInput) editorInput).getFile();
+                                       project = file.getProject();
+                               }
+                               else {
+                                       return new ICompletionProposal[0];
+                               }
                        }
                }