Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/GlobalRefreshResourceSelectionPage.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/GlobalRefreshResourceSelectionPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/GlobalRefreshResourceSelectionPage.java
index 3f53fbe67..67bf31823 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/GlobalRefreshResourceSelectionPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/GlobalRefreshResourceSelectionPage.java
@@ -332,9 +332,18 @@ public class GlobalRefreshResourceSelectionPage extends WizardPage {
}
private IResource[] getResourcesFromSelection() {
- ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().getActivePart().getSite().getSelectionProvider().getSelection();
- if(selection instanceof IStructuredSelection) {
- return Utils.getResources(((IStructuredSelection)selection).toArray());
+ IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if (activeWorkbenchWindow != null) {
+ IWorkbenchPart activePart = activeWorkbenchWindow.getPartService().getActivePart();
+ if (activePart != null) {
+ ISelectionProvider selectionProvider = activePart.getSite().getSelectionProvider();
+ if (selectionProvider != null) {
+ ISelection selection = selectionProvider.getSelection();
+ if(selection instanceof IStructuredSelection) {
+ return Utils.getResources(((IStructuredSelection)selection).toArray());
+ }
+ }
+ }
}
return new IResource[0];
}

Back to the top