Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2012-10-14 12:50:36 -0400
committerFrank Becker2012-10-14 12:50:36 -0400
commitb9bbfbd372f3e5084c8fc10357c173a4a01f5dfa (patch)
tree6e597a72cdab36d0fa28741520994a4cd9bc4ff5 /org.eclipse.mylyn.tasks.ui
parent3f5048053279a0b69ec70deba5a3e4a06a4ee467 (diff)
downloadorg.eclipse.mylyn.tasks-b9bbfbd372f3e5084c8fc10357c173a4a01f5dfa.tar.gz
org.eclipse.mylyn.tasks-b9bbfbd372f3e5084c8fc10357c173a4a01f5dfa.tar.xz
org.eclipse.mylyn.tasks-b9bbfbd372f3e5084c8fc10357c173a4a01f5dfa.zip
ASSIGNED - bug 391753: NPE while refreshing a bugzilla query
https://bugs.eclipse.org/bugs/show_bug.cgi?id=391753
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeSelectedAction.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeSelectedAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeSelectedAction.java
index b2f248337..493f83286 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeSelectedAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeSelectedAction.java
@@ -19,9 +19,12 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.LocalTask;
import org.eclipse.mylyn.internal.tasks.core.Person;
@@ -29,6 +32,7 @@ import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
import org.eclipse.mylyn.internal.tasks.core.ScheduledTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.TaskCategory;
import org.eclipse.mylyn.internal.tasks.core.TaskGroup;
+import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
@@ -129,6 +133,13 @@ public class SynchronizeSelectedAction extends ActionDelegate implements IViewAc
for (RepositoryQuery query : queriesToSync) {
TaskRepository repos = TasksUi.getRepositoryManager().getRepository(query.getConnectorKind(),
query.getRepositoryUrl());
+ if (repos == null) {
+ StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
+ "Failed to synchronize query \"" + query.getUrl() //$NON-NLS-1$
+ + "\" because Repository is null")); //$NON-NLS-1$
+ continue;
+ }
+
Set<RepositoryQuery> queries = repositoriesToSync.get(repos);
if (queries == null) {
queries = new HashSet<RepositoryQuery>();

Back to the top