1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-08 16:55:38 +02:00

Check existence of resource before deleting markers.

This commit is contained in:
Markus Schorn 2008-04-03 17:50:08 +00:00
parent 2421356998
commit 433aa00c34

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007 Google, Inc and others.
* Copyright (c) 2007, 2008 Google, Inc and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -141,6 +141,7 @@ public class TodoTaskUpdater implements ITodoTaskUpdater {
// run this in a job in order not to block the indexer (bug 210730).
if (!pathToTaskList.isEmpty()) {
Job job= new Job(Messages.TodoTaskUpdater_UpdateJob) {
@Override
protected IStatus run(IProgressMonitor monitor) {
MultiStatus status= new MultiStatus(CCorePlugin.PLUGIN_ID, 0,
Messages.TodoTaskUpdater_UpdateJob, null);
@ -205,8 +206,12 @@ public class TodoTaskUpdater implements ITodoTaskUpdater {
// run this in a job in order not to block the indexer (bug 210730).
Job job= new Job(Messages.TodoTaskUpdater_DeleteJob) {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
if (resource == null || !resource.exists()) {
return Status.CANCEL_STATUS;
}
resource.deleteMarkers(ICModelMarker.TASK_MARKER, false, IResource.DEPTH_INFINITE);
} catch (CoreException e) {
if (resource.exists()) {