summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorLorenzo Bettini2013-01-25 14:32:03 (EST)
committer Paul Webster2013-01-25 14:32:03 (EST)
commit13ea62410aff94f6d2c4d52679a4e8ae581e48d9 (patch)
tree7f30a231b87728d2b423e101c331a246cb6ebb6a
parent3716479c3e097e01fbc154204dd347de76492f54 (diff)
downloadeclipse.platform.ui-13ea62410aff94f6d2c4d52679a4e8ae581e48d9.zip
eclipse.platform.ui-13ea62410aff94f6d2c4d52679a4e8ae581e48d9.tar.gz
eclipse.platform.ui-13ea62410aff94f6d2c4d52679a4e8ae581e48d9.tar.bz2
Bug 397834 - [GlobalActions] SaveAction throws NPE for saveable views inv20130125-193203
RCP applications
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/SaveAction.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/SaveAction.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/SaveAction.java
index e677c6f..0ce8f87 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/SaveAction.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/SaveAction.java
@@ -17,6 +17,7 @@ import org.eclipse.ui.ISaveablesSource;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbenchCommandConstants;
import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
/**
@@ -65,9 +66,15 @@ public class SaveAction extends BaseSaveAction implements IBackgroundSaveListene
*/
ISaveablePart saveView = getSaveableView();
if (saveView != null) {
- ((WorkbenchPage) getActivePart().getSite().getPage()).saveSaveable(saveView, false,
- false);
- return;
+ IWorkbenchPart activePart = getActivePart();
+ WorkbenchPage workbenchPage;
+ if (activePart != null) {
+ workbenchPage = (WorkbenchPage) activePart.getSite().getPage();
+ } else {
+ workbenchPage = (WorkbenchPage) getActivePage();
+ }
+ workbenchPage.saveSaveable(saveView, false, false);
+ return;
}
IEditorPart part = getActiveEditor();