aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/github/daneren2005/dsub/util/BackgroundTask.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/github/daneren2005/dsub/util/BackgroundTask.java b/src/github/daneren2005/dsub/util/BackgroundTask.java
index 4760577f..6ca8ea4c 100644
--- a/src/github/daneren2005/dsub/util/BackgroundTask.java
+++ b/src/github/daneren2005/dsub/util/BackgroundTask.java
@@ -136,11 +136,10 @@ public abstract class BackgroundTask<T> implements ProgressListener {
public void cancel() {
cancelled = true;
- if(task != null) {
- task.cancel();
- }
if(cancelListener != null) {
cancelListener.onCancel();
+ } else if(task != null) {
+ task.cancel();
}
}
public boolean isCancelled() {