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 36AE4DAFC for ; Wed, 18 Jul 2012 21:05:46 +0000 (UTC) Received: (qmail 47098 invoked by uid 500); 18 Jul 2012 21:05:46 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 47071 invoked by uid 500); 18 Jul 2012 21:05:46 -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 47005 invoked by uid 99); 18 Jul 2012 21:05:46 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jul 2012 21:05:46 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id EFB24153E0; Wed, 18 Jul 2012 21:05:45 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: purplecabbage@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [10/10] js commit: only call success when running + we have retrieved a value at least once. Message-Id: <20120718210545.EFB24153E0@tyr.zones.apache.org> Date: Wed, 18 Jul 2012 21:05:45 +0000 (UTC) only call success when running + we have retrieved a value at least once. Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/1dabf248 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/1dabf248 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/1dabf248 Branch: refs/heads/master Commit: 1dabf248f1b8a23252dd28ac092ba1e80330a0dd Parents: 3d0790c Author: Jesse Authored: Sun Jul 15 02:59:42 2012 -0700 Committer: Jesse Committed: Sun Jul 15 02:59:42 2012 -0700 ---------------------------------------------------------------------- lib/common/plugin/accelerometer.js | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/1dabf248/lib/common/plugin/accelerometer.js ---------------------------------------------------------------------- diff --git a/lib/common/plugin/accelerometer.js b/lib/common/plugin/accelerometer.js index f343902..e27c92b 100644 --- a/lib/common/plugin/accelerometer.js +++ b/lib/common/plugin/accelerometer.js @@ -126,7 +126,10 @@ var accelerometer = { if (running) { // If we're already running then immediately invoke the success callback - successCallback(accel); + // but only if we have retreived a value, sample code does not check for null ... + if(accel) { + successCallback(accel); + } } else { start(); }