Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

packages-apps-CMFileManager: Commit

packages/apps/CMFileManager


Commit MetaInfo

Revision901e396ccac70ae23a9b2a95ed83387909af1e5e (tree)
Time2016-01-26 03:25:16
AuthorAbhishek Gilra <agilra@cyng...>
CommiterHoward Harte

Log Message

Adding NULL checks AsyncResultProgram.java

Discovered NULL object dereference during the monkey test. Resolving possible NULL dereferences.
Issue-Id: YAM-61

Change-Id: I2b03338557d0f5590678cb1c0532c5cc6f586049

Change Summary

Incremental Difference

--- 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
127127 */
128128 public final void onRequestEndParsePartialResult(boolean cancelled) {
129129 synchronized (this.mSync) {
130- this.mWorkerThread.mAlive = false;
131- this.mSync.notify();
130+ if (this.mWorkerThread != null) {
131+ this.mWorkerThread.mAlive = false;
132+ this.mSync.notify();
133+ }
132134 }
133135
134136 try {
@@ -258,8 +260,10 @@ public abstract class AsyncResultProgram
258260
259261 //Stop the thread
260262 synchronized (this.mSync) {
261- this.mWorkerThread.mAlive = false;
262- this.mSync.notify();
263+ if (this.mWorkerThread != null) {
264+ this.mWorkerThread.mAlive = false;
265+ this.mSync.notify();
266+ }
263267 }
264268
265269 //Notify cancellation
@@ -285,8 +289,10 @@ public abstract class AsyncResultProgram
285289
286290 //Stop the thread
287291 synchronized (this.mSync) {
288- this.mWorkerThread.mAlive = false;
289- this.mSync.notify();
292+ if (this.mWorkerThread != null) {
293+ this.mWorkerThread.mAlive = false;
294+ this.mSync.notify();
295+ }
290296 }
291297
292298 //Notify ending
Show on old repository browser