diff options
author | Scott Jackson <daneren2005@gmail.com> | 2016-06-14 17:24:31 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2016-06-14 17:24:31 -0700 |
commit | 9bfe3e3950b43485b4557e54aae622d7e57faa26 (patch) | |
tree | 659a926fc9babf73998862530e36f2d144760d10 /app/src/main | |
parent | 229a45cbded29c975d29d60e3b879266c32e3fbe (diff) | |
download | dsub-9bfe3e3950b43485b4557e54aae622d7e57faa26.tar.gz dsub-9bfe3e3950b43485b4557e54aae622d7e57faa26.tar.bz2 dsub-9bfe3e3950b43485b4557e54aae622d7e57faa26.zip |
try/catch onDone results as well
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/util/BackgroundTask.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/util/BackgroundTask.java b/app/src/main/java/github/daneren2005/dsub/util/BackgroundTask.java index fce855fe..31e83200 100644 --- a/app/src/main/java/github/daneren2005/dsub/util/BackgroundTask.java +++ b/app/src/main/java/github/daneren2005/dsub/util/BackgroundTask.java @@ -208,8 +208,18 @@ public abstract class BackgroundTask<T> implements ProgressListener { handler.post(new Runnable() { @Override public void run() { - if(!isCancelled()) { - onDone(result); + if (!isCancelled()) { + try { + onDone(result); + } catch (Throwable t) { + if(!isCancelled()) { + try { + onError(t); + } catch(Exception e) { + // Don't care + } + } + } } taskStart.set(false); |