From 02a8d38951be68feca591e597de45276d416c1a6 Mon Sep 17 00:00:00 2001 From: Eugene Vigdorchik Date: Mon, 14 Mar 2005 16:21:52 +0300 Subject: [PATCH] Well, hopefully fixed transforming code fragments' chameleons --- .../extractMethod/ExtractMethodHandler.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/com/intellij/refactoring/extractMethod/ExtractMethodHandler.java b/source/com/intellij/refactoring/extractMethod/ExtractMethodHandler.java index 4338c3e377cb..f4108fb79e63 100644 --- a/source/com/intellij/refactoring/extractMethod/ExtractMethodHandler.java +++ b/source/com/intellij/refactoring/extractMethod/ExtractMethodHandler.java @@ -127,10 +127,12 @@ public class ExtractMethodHandler implements RefactoringActionHandler { } public void invoke(Project project, PsiElement[] elements, DataContext dataContext) { - final PsiFile file = (PsiFile)dataContext.getData(DataConstants.PSI_FILE); - final Editor editor = (Editor)dataContext.getData(DataConstants.EDITOR); - if (file != null && editor != null) { - invokeOnElements(elements, project, file, editor); + if (dataContext != null) { + final PsiFile file = (PsiFile)dataContext.getData(DataConstants.PSI_FILE); + final Editor editor = (Editor)dataContext.getData(DataConstants.EDITOR); + if (file != null && editor != null) { + invokeOnElements(elements, project, file, editor); + } } } } \ No newline at end of file