mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 01:05:38 +02:00
Check existence of resource before deleting markers.
This commit is contained in:
parent
2421356998
commit
433aa00c34
1 changed files with 6 additions and 1 deletions
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* 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).
|
// run this in a job in order not to block the indexer (bug 210730).
|
||||||
if (!pathToTaskList.isEmpty()) {
|
if (!pathToTaskList.isEmpty()) {
|
||||||
Job job= new Job(Messages.TodoTaskUpdater_UpdateJob) {
|
Job job= new Job(Messages.TodoTaskUpdater_UpdateJob) {
|
||||||
|
@Override
|
||||||
protected IStatus run(IProgressMonitor monitor) {
|
protected IStatus run(IProgressMonitor monitor) {
|
||||||
MultiStatus status= new MultiStatus(CCorePlugin.PLUGIN_ID, 0,
|
MultiStatus status= new MultiStatus(CCorePlugin.PLUGIN_ID, 0,
|
||||||
Messages.TodoTaskUpdater_UpdateJob, null);
|
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).
|
// run this in a job in order not to block the indexer (bug 210730).
|
||||||
Job job= new Job(Messages.TodoTaskUpdater_DeleteJob) {
|
Job job= new Job(Messages.TodoTaskUpdater_DeleteJob) {
|
||||||
|
@Override
|
||||||
protected IStatus run(IProgressMonitor monitor) {
|
protected IStatus run(IProgressMonitor monitor) {
|
||||||
try {
|
try {
|
||||||
|
if (resource == null || !resource.exists()) {
|
||||||
|
return Status.CANCEL_STATUS;
|
||||||
|
}
|
||||||
resource.deleteMarkers(ICModelMarker.TASK_MARKER, false, IResource.DEPTH_INFINITE);
|
resource.deleteMarkers(ICModelMarker.TASK_MARKER, false, IResource.DEPTH_INFINITE);
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
if (resource.exists()) {
|
if (resource.exists()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue