bug 712719 - NullPointerException at org.mozilla.gecko.GeckoAppShell.notifyIMEEnabled r=dougt a=akeybl
authorBrad Lassey <blassey@mozilla.com>
Wed, 21 Dec 2011 18:14:46 -0500
changeset 84883 1ae3a15ae765f9c9096efabb536ab4b69830ef81
parent 84882 a0027a963235481635e80db132bb15f3b80e92de
child 84884 f09ae3fa7790706e2ee2d4b9f410b6c3e124a556
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdougt, akeybl
bugs712719
milestone11.0a2
bug 712719 - NullPointerException at org.mozilla.gecko.GeckoAppShell.notifyIMEEnabled r=dougt a=akeybl
mobile/android/base/GeckoAppShell.java
--- a/mobile/android/base/GeckoAppShell.java
+++ b/mobile/android/base/GeckoAppShell.java
@@ -489,26 +489,29 @@ public class GeckoAppShell
 
     // Tell the Gecko event loop that an event is available.
     public static native void notifyGeckoOfEvent(GeckoEvent event);
 
     /*
      *  The Gecko-side API: API methods that Gecko calls
      */
     public static void notifyIME(int type, int state) {
-        mInputConnection.notifyIME(type, state);
+        if (mInputConnection != null)
+            mInputConnection.notifyIME(type, state);
     }
 
     public static void notifyIMEEnabled(int state, String typeHint,
                                         String actionHint, boolean landscapeFS) {
-        mInputConnection.notifyIMEEnabled(state, typeHint, actionHint, landscapeFS);
+        if (mInputConnection != null)
+            mInputConnection.notifyIMEEnabled(state, typeHint, actionHint, landscapeFS);
     }
 
     public static void notifyIMEChange(String text, int start, int end, int newEnd) {
-        mInputConnection.notifyIMEChange(text, start, end, newEnd);
+        if (mInputConnection != null)
+            mInputConnection.notifyIMEChange(text, start, end, newEnd);
     }
 
     private static CountDownLatch sGeckoPendingAcks = null;
 
     // Block the current thread until the Gecko event loop is caught up
     synchronized public static void geckoEventSync() {
         sGeckoPendingAcks = new CountDownLatch(1);
         GeckoAppShell.sendEventToGecko(