aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbhishek Gilra <agilra@cyngn.com>2016-01-21 18:09:53 -0800
committerHoward Harte <hharte@cyngn.com>2016-01-23 14:23:37 -0800
commit2c9f1dbcae2be780636c28f2d151daff6088c083 (patch)
tree8397be7bb9e02565e0303d84da7c127ab07c7f66
parentc23f255e99434871efdb5db6a2889ef439a0181b (diff)
downloadandroid_packages_apps_CMFileManager-2c9f1dbcae2be780636c28f2d151daff6088c083.tar.gz
android_packages_apps_CMFileManager-2c9f1dbcae2be780636c28f2d151daff6088c083.tar.bz2
android_packages_apps_CMFileManager-2c9f1dbcae2be780636c28f2d151daff6088c083.zip
Adding NULL checks AsyncResultProgram.java
Discovered NULL object dereference during the monkey test. Resolving possible NULL dereferences. Issue-Id: YAM-61 Change-Id: I2b03338557d0f5590678cb1c0532c5cc6f586049
-rw-r--r--src/com/cyanogenmod/filemanager/commands/shell/AsyncResultProgram.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/com/cyanogenmod/filemanager/commands/shell/AsyncResultProgram.java b/src/com/cyanogenmod/filemanager/commands/shell/AsyncResultProgram.java
index 94e8447b..5d633e33 100644
--- a/src/com/cyanogenmod/filemanager/commands/shell/AsyncResultProgram.java
+++ b/src/com/cyanogenmod/filemanager/commands/shell/AsyncResultProgram.java
@@ -127,8 +127,10 @@ public abstract class AsyncResultProgram
*/
public final void onRequestEndParsePartialResult(boolean cancelled) {
synchronized (this.mSync) {
- this.mWorkerThread.mAlive = false;
- this.mSync.notify();
+ if (this.mWorkerThread != null) {
+ this.mWorkerThread.mAlive = false;
+ this.mSync.notify();
+ }
}
try {
@@ -258,8 +260,10 @@ public abstract class AsyncResultProgram
//Stop the thread
synchronized (this.mSync) {
- this.mWorkerThread.mAlive = false;
- this.mSync.notify();
+ if (this.mWorkerThread != null) {
+ this.mWorkerThread.mAlive = false;
+ this.mSync.notify();
+ }
}
//Notify cancellation
@@ -285,8 +289,10 @@ public abstract class AsyncResultProgram
//Stop the thread
synchronized (this.mSync) {
- this.mWorkerThread.mAlive = false;
- this.mSync.notify();
+ if (this.mWorkerThread != null) {
+ this.mWorkerThread.mAlive = false;
+ this.mSync.notify();
+ }
}
//Notify ending