Return-Path: X-Original-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DFC6898BB for ; Tue, 3 Jan 2012 18:57:55 +0000 (UTC) Received: (qmail 77571 invoked by uid 500); 3 Jan 2012 18:57:55 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 77552 invoked by uid 500); 3 Jan 2012 18:57:55 -0000 Mailing-List: contact callback-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-commits@incubator.apache.org Received: (qmail 77545 invoked by uid 99); 3 Jan 2012 18:57:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jan 2012 18:57:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.114] (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jan 2012 18:57:53 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 53E0031571F; Tue, 3 Jan 2012 18:57:08 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bowserj@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [3/50] git commit: Fix NullPointerException in DroidGap.onMeasure() Message-Id: <20120103185708.53E0031571F@tyr.zones.apache.org> Date: Tue, 3 Jan 2012 18:57:08 +0000 (UTC) X-Virus-Checked: Checked by ClamAV on apache.org Fix NullPointerException in DroidGap.onMeasure() It looks like on some devices the onMeasure() method is called before the callbackServer is instantiated. This causes a NullPointerException which kills the application. Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/fae551f0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/fae551f0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/fae551f0 Branch: refs/heads/master Commit: fae551f0cea22c9843911cdcc2472b4e8135c93d Parents: 1511183 Author: macdonst Authored: Thu Dec 22 09:47:40 2011 +0800 Committer: macdonst Committed: Thu Dec 22 09:51:11 2011 +0800 ---------------------------------------------------------------------- framework/src/com/phonegap/DroidGap.java | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/fae551f0/framework/src/com/phonegap/DroidGap.java ---------------------------------------------------------------------- diff --git a/framework/src/com/phonegap/DroidGap.java b/framework/src/com/phonegap/DroidGap.java index 26a04f5..f906567 100755 --- a/framework/src/com/phonegap/DroidGap.java +++ b/framework/src/com/phonegap/DroidGap.java @@ -1695,14 +1695,18 @@ public class DroidGap extends PhonegapActivity { // If the height as gotten bigger then we will assume the soft keyboard has // gone away. else if (height > oldHeight) { - LOG.v(TAG, "Throw hide keyboard event"); - callbackServer.sendJavascript("PhoneGap.fireDocumentEvent('hidekeyboard');"); + if (callbackServer != null) { + LOG.v(TAG, "Throw hide keyboard event"); + callbackServer.sendJavascript("PhoneGap.fireDocumentEvent('hidekeyboard');"); + } } // If the height as gotten smaller then we will assume the soft keyboard has // been displayed. else if (height < oldHeight) { - LOG.v(TAG, "Throw show keyboard event"); - callbackServer.sendJavascript("PhoneGap.fireDocumentEvent('showkeyboard');"); + if (callbackServer != null) { + LOG.v(TAG, "Throw show keyboard event"); + callbackServer.sendJavascript("PhoneGap.fireDocumentEvent('showkeyboard');"); + } } // Update the old height for the next event