diff options
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui/src/org')
2 files changed, 12 insertions, 5 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskRepositoryLocationUi.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskRepositoryLocationUi.java index 1d61d5272..9a87cdadf 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskRepositoryLocationUi.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskRepositoryLocationUi.java @@ -53,11 +53,15 @@ public class TaskRepositoryLocationUi extends TaskRepositoryLocation { } PasswordRunner runner = new PasswordRunner(authType, message); - PlatformUI.getWorkbench().getDisplay().syncExec(runner); - if (runner.isCanceled()) { - throw new OperationCanceledException(); - } - if (!runner.isChanged()) { + if (!PlatformUI.getWorkbench().getDisplay().isDisposed()) { + PlatformUI.getWorkbench().getDisplay().syncExec(runner); + if (runner.isCanceled()) { + throw new OperationCanceledException(); + } + if (!runner.isChanged()) { + throw new UnsupportedRequestException(); + } + } else { throw new UnsupportedRequestException(); } } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java index 959e4a669..1ee2b481a 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java @@ -781,6 +781,9 @@ public class TasksUiInternal { * @return Shell or <code>null</code> */ public static Shell getShell() { + if (!PlatformUI.isWorkbenchRunning() || PlatformUI.getWorkbench().isClosing()) { + return null; + } Shell modal = getModalShellExcluding(null); if (modal != null) { return modal; |