From b5adbc1dc7a349114e5309986d39104aa083a66c Mon Sep 17 00:00:00 2001 From: bananeweizen Date: Sun, 23 Apr 2006 14:39:29 +0000 Subject: [PATCH] bug 1469012, exception in CompletionProposal --- .../phpeditor/php/PHPCompletionProcessor.java | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) 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]; + } } } -- 1.7.1