Bug 1449829 - Prevent calling getPid() on null IChildProcess. r=jchen, a=RyanVM
authorRandall Barker <rbarker@mozilla.com>
Thu, 29 Mar 2018 09:39:07 -0700
changeset 462973 95e02bd6a13f91f5eb2465f0949a6f01de37db7d
parent 462972 ab6e435525336b44ee1ee28025addb094732c935
child 462974 d8c0fba8b94adbdef6e759885c9d79cb7ae2d2c0
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjchen, RyanVM
bugs1449829
milestone60.0
Bug 1449829 - Prevent calling getPid() on null IChildProcess. r=jchen, a=RyanVM MozReview-Commit-ID: 32LuYFqL47n
mobile/android/geckoview/src/main/java/org/mozilla/gecko/process/GeckoProcessManager.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/process/GeckoProcessManager.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/process/GeckoProcessManager.java
@@ -51,17 +51,17 @@ public final class GeckoProcessManager e
         private IChildProcess mChild;
         private int mPid;
 
         public ChildConnection(String type) {
             mType = type;
         }
 
         public synchronized int getPid() {
-            if (mPid == 0) {
+            if ((mPid == 0) && (mChild != null)) {
                 try {
                     mPid = mChild.getPid();
                 } catch (final RemoteException e) {
                     Log.e(LOGTAG, "Cannot get pid for " + mType, e);
                 }
             }
             return mPid;
         }