From: bananeweizen Date: Sun, 23 Apr 2006 14:39:29 +0000 (+0000) Subject: bug 1469012, exception in CompletionProposal X-Git-Url: http://git.phpeclipse.com bug 1469012, exception in CompletionProposal --- diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCompletionProcessor.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCompletionProcessor.java index 2046d7c..cce63ca 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCompletionProcessor.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCompletionProcessor.java @@ -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]; + } } }