OSDN Git Service

fix monkey-triggered crash
authorCary Clark <cary@android.com>
Thu, 25 Mar 2010 15:17:03 +0000 (11:17 -0400)
committerCary Clark <cary@android.com>
Thu, 25 Mar 2010 15:26:41 +0000 (11:26 -0400)
While we're in there, change to void since callers never
use boolean function result.

Change-Id: Ia62f9dd5bac252a17bcc5086daed1407a2dbb4ff
http://b/2544188

src/com/android/browser/BrowserActivity.java

index 406132f..84f165c 100644 (file)
@@ -1037,8 +1037,9 @@ public class BrowserActivity extends Activity
         mTabControl.freeMemory();
     }
 
-    private boolean resumeWebViewTimers() {
+    private void resumeWebViewTimers() {
         Tab tab = mTabControl.getCurrentTab();
+        if (tab == null) return; // monkey can trigger this
         boolean inLoad = tab.inLoad();
         if ((!mActivityInPause && !inLoad) || (mActivityInPause && inLoad)) {
             CookieSyncManager.getInstance().startSync();
@@ -1046,9 +1047,6 @@ public class BrowserActivity extends Activity
             if (w != null) {
                 w.resumeTimers();
             }
-            return true;
-        } else {
-            return false;
         }
     }