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

Commit c92de67d authored by Derek Sollenberger's avatar Derek Sollenberger
Browse files

Fix NPE when WebView is being destroyed prior to callback completion.

Change-Id: I964c8b7846e37b554b9bda8cda4f62f3e3851691
http://b/2947192
parent 9c12bd39
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -938,7 +938,7 @@ public class WebView extends AbsoluteLayout
                        return;
                    }

                    if (sGoogleApps.contains(packageName)) {
                    if (sGoogleApps.contains(packageName) && mWebViewCore != null) {
                        if (Intent.ACTION_PACKAGE_ADDED.equals(action)) {
                            mWebViewCore.sendMessage(EventHub.ADD_PACKAGE_NAME, packageName);
                        } else {
@@ -975,8 +975,10 @@ public class WebView extends AbsoluteLayout
            // Executes on the UI thread
            @Override
            protected void onPostExecute(Set<String> installedPackages) {
                if (mWebViewCore != null) {
                    mWebViewCore.sendMessage(EventHub.ADD_PACKAGE_NAMES, installedPackages);
                }
            }
        };
        task.execute();
    }