Bug 794908 - Guard against potential NPE. r=cpeterson
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 27 Sep 2012 12:37:08 -0400
changeset 108425 563605815bc382bac852e28accd0868669dc9f60
parent 108424 e6fd6841e7f3bbf2a113da7c24a8ae7f3c9fcb14
child 108426 c5a7b7544f124c4cfc8540c5eeaf5745eb1182fd
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewerscpeterson
bugs794908
milestone18.0a1
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;
                                 }