summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorThomas Beyer2013-03-04 09:15:43 (EST)
committer Paul Webster2013-03-04 09:15:43 (EST)
commit1b4721e0c401edbae7724c8168988189848ed5c3 (patch)
tree5a8cb134fb637b983f73987e53c1eaef94e32e89
parent0a30e5fae41ba9f0997aab29e696e6bf77b0ae0f (diff)
downloadeclipse.platform.ui-1b4721e0c401edbae7724c8168988189848ed5c3.zip
eclipse.platform.ui-1b4721e0c401edbae7724c8168988189848ed5c3.tar.gz
eclipse.platform.ui-1b4721e0c401edbae7724c8168988189848ed5c3.tar.bz2
Bug 394499 - NavigatorSaveablesService NPE during shutdownv20130304-141543
-rw-r--r--bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorSaveablesService.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorSaveablesService.java b/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorSaveablesService.java
index fd248e9..7391102 100644
--- a/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorSaveablesService.java
+++ b/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorSaveablesService.java
@@ -280,17 +280,20 @@ public class NavigatorSaveablesService implements INavigatorSaveablesService, Vi
}
public synchronized Saveable[] getActiveSaveables() {
- ITreeContentProvider contentProvider = (ITreeContentProvider) viewer
+ if(!isDisposed()){
+ ITreeContentProvider contentProvider = (ITreeContentProvider) viewer
.getContentProvider();
- IStructuredSelection selection = (IStructuredSelection) viewer
- .getSelection();
- if (selection instanceof ITreeSelection) {
- return getActiveSaveablesFromTreeSelection((ITreeSelection) selection);
- } else if (contentProvider instanceof ITreePathContentProvider) {
- return getActiveSaveablesFromTreePathProvider(selection, (ITreePathContentProvider) contentProvider);
- } else {
- return getActiveSaveablesFromTreeProvider(selection, contentProvider);
+ IStructuredSelection selection = (IStructuredSelection) viewer
+ .getSelection();
+ if (selection instanceof ITreeSelection) {
+ return getActiveSaveablesFromTreeSelection((ITreeSelection) selection);
+ } else if (contentProvider instanceof ITreePathContentProvider) {
+ return getActiveSaveablesFromTreePathProvider(selection, (ITreePathContentProvider) contentProvider);
+ } else {
+ return getActiveSaveablesFromTreeProvider(selection, contentProvider);
+ }
}
+ return new Saveable[0];
}
/**