Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2013-03-12 14:32:51 +0000
committerDani Megert2013-03-12 14:32:51 +0000
commit0926366d519d68d9dd547f1e873c1bd5ff461370 (patch)
tree76cd1cff2b37040498f2fdc9af7ab44649817766
parent8eb5d915d6bdb101cbb3597425c9892ee08f3fab (diff)
downloadeclipse.platform.text-0926366d519d68d9dd547f1e873c1bd5ff461370.tar.gz
eclipse.platform.text-0926366d519d68d9dd547f1e873c1bd5ff461370.tar.xz
eclipse.platform.text-0926366d519d68d9dd547f1e873c1bd5ff461370.zip
Fixed bug 403040: NPE on clicking the 'Search' tool button
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java
index 9c131267022..5c6374d898f 100644
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java
+++ b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java
@@ -266,12 +266,17 @@ public class SearchDialog extends ExtendedDialogWindow implements ISearchPageCon
public IEditorPart getActiveEditor() {
IWorkbenchPage activePage= fWorkbenchWindow.getActivePage();
- if (activePage != null) {
- IEditorPart activeEditor= activePage.getActiveEditor();
- IWorkbenchPart activePart= activePage.getActivePart();
- if (activeEditor == activePart || isOldSearchView(activePart))
- return activeEditor;
- }
+ if (activePage == null)
+ return null;
+
+ IWorkbenchPart activePart= activePage.getActivePart();
+ if (activePart == null)
+ return null;
+
+ IEditorPart activeEditor= activePage.getActiveEditor();
+ if (activeEditor == activePart || isOldSearchView(activePart))
+ return activeEditor;
+
return null;
}

Back to the top