Bug 794908 - Guard against potential NPE. r=cpeterson
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 27 Sep 2012 12:37:08 -0400
changeset 108316 563605815bc382bac852e28accd0868669dc9f60
parent 108315 e6fd6841e7f3bbf2a113da7c24a8ae7f3c9fcb14
child 108317 c5a7b7544f124c4cfc8540c5eeaf5745eb1182fd
push id23552
push userryanvm@gmail.com
push dateFri, 28 Sep 2012 03:05:08 +0000
treeherdermozilla-central@2d96ee8d9dd4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpeterson
bugs794908
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 794908 - Guard against potential NPE. r=cpeterson
mobile/android/base/ScreenshotHandler.java
--- a/mobile/android/base/ScreenshotHandler.java
+++ b/mobile/android/base/ScreenshotHandler.java
@@ -299,16 +299,19 @@ public final class ScreenshotHandler imp
                                         final int right, final int bottom,
                                         final int bufferWidth, final int bufferHeight, final int token) {
         GeckoAppShell.getHandler().post(new Runnable() {
             public void run() {
                 switch (token) {
                     case SCREENSHOT_CHECKERBOARD:
                     {
                         ScreenshotHandler handler = getInstance();
+                        if (handler == null) {
+                            break;
+                        }
                         if (Tabs.getInstance().getSelectedTab().getId() == tabId) {
                             PendingScreenshot current;
                             synchronized (handler.mPendingScreenshots) {
                                 current = handler.mPendingScreenshots.element();
                                 current.slicePainted(left, top, right, bottom);
                                 if (current.sendNextEventToGecko()) {
                                     break;
                                 }