Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dffbdb5b authored by Abhishek Gilra's avatar Abhishek Gilra
Browse files

Adding NULL checks AsyncResultProgram.java

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

Change-Id: I2b03338557d0f5590678cb1c0532c5cc6f586049
parent 948d07cc
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -127,9 +127,11 @@ public abstract class AsyncResultProgram
     */
    public final void onRequestEndParsePartialResult(boolean cancelled) {
        synchronized (this.mSync) {
            if (this.mWorkerThread != null) {
                this.mWorkerThread.mAlive = false;
                this.mSync.notify();
            }
        }

        try {
            this.mWorkerThread.join();
@@ -258,9 +260,11 @@ public abstract class AsyncResultProgram

        //Stop the thread
        synchronized (this.mSync) {
            if (this.mWorkerThread != null) {
                this.mWorkerThread.mAlive = false;
                this.mSync.notify();
            }
        }

        //Notify cancellation
        if (this.mOnCancelListener != null) {
@@ -285,9 +289,11 @@ public abstract class AsyncResultProgram

        //Stop the thread
        synchronized (this.mSync) {
            if (this.mWorkerThread != null) {
                this.mWorkerThread.mAlive = false;
                this.mSync.notify();
            }
        }

        //Notify ending
        SIGNAL signal = onRequestEnd();