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-25 10:25:16 -0800
commit901e396ccac70ae23a9b2a95ed83387909af1e5e (patch)
tree62e3861d743b613d0d841eab0d85007a01bb4ca0
parent04abecbd076213fb735d3569c3e12cb6175c6f93 (diff)
downloadandroid_packages_apps_CMFileManager-901e396ccac70ae23a9b2a95ed83387909af1e5e.tar.gz
android_packages_apps_CMFileManager-901e396ccac70ae23a9b2a95ed83387909af1e5e.tar.bz2
android_packages_apps_CMFileManager-901e396ccac70ae23a9b2a95ed83387909af1e5e.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