Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java
index de0c4a03b7f..ef89b8a8bc9 100644
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java
+++ b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java
@@ -5,6 +5,7 @@
package org.eclipse.search.internal.ui;
+import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.IPath;
import org.eclipse.swt.SWT;
@@ -310,8 +311,10 @@ public class SearchResultViewer extends TableViewer {
ISelection selection= getSelection();
if (selection instanceof IStructuredSelection) {
Object entry= ((IStructuredSelection)selection).getFirstElement();
- return (entry instanceof ISearchResultViewEntry) &&
- ((ISearchResultViewEntry)entry).getSelectedMarker().getAttribute(SearchUI.POTENTIAL_MATCH, false);
+ if (entry instanceof ISearchResultViewEntry) {
+ IMarker marker= ((ISearchResultViewEntry)entry).getSelectedMarker();
+ return marker != null && marker.getAttribute(SearchUI.POTENTIAL_MATCH, false);
+ }
}
return false;
}

Back to the top