fix NPE in SimpleWorker cleanup

This commit is contained in:
Hannes Janetzek 2014-03-06 14:42:43 +01:00
parent 10a00753e7
commit b04b5f235c

View File

@ -43,7 +43,8 @@ public abstract class SimpleWorker<T> implements Runnable {
mRunning = false; mRunning = false;
mDelayed = false; mDelayed = false;
mWait = false; mWait = false;
cleanup(mTaskTodo); if (mTaskTodo != null)
cleanup(mTaskTodo);
finish(); finish();
return; return;
} }
@ -51,7 +52,7 @@ public abstract class SimpleWorker<T> implements Runnable {
// FIXME: mTaskTodo == null? // FIXME: mTaskTodo == null?
if (mDelayed || mTaskTodo == null) { if (mDelayed || mTaskTodo == null) {
if (mDelayed) if (mDelayed && mTaskTodo != null)
onMainLoop(mTaskTodo); onMainLoop(mTaskTodo);
// entered on main-loop // entered on main-loop