cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject git commit: Fix Beep exception on Android when no argument passed
Date Fri, 27 Jun 2014 18:10:24 GMT
Repository: cordova-plugin-dialogs
Updated Branches:
  refs/heads/master fd874c4f3 -> bb17d7d1b


Fix Beep exception on Android when no argument passed

In iOS, if you call the beep function and don't provide a count, it
plays a single beep. On Android, however, it always attempts to load the
fix object in the array, which is null if no count is provided, causes
an exception to be thrown, and no beep to occur. The simplest fix for
this is to simply pass `1` if no count is provide from the web.

close #20


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/commit/bb17d7d1
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/tree/bb17d7d1
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/diff/bb17d7d1

Branch: refs/heads/master
Commit: bb17d7d1bf3c38d2a128c56eb522ca4391f5721f
Parents: fd874c4
Author: Graham Mueller <graham.mueller315@gmail.com>
Authored: Wed Apr 30 10:10:59 2014 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Fri Jun 27 14:09:45 2014 -0400

----------------------------------------------------------------------
 www/notification.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/blob/bb17d7d1/www/notification.js
----------------------------------------------------------------------
diff --git a/www/notification.js b/www/notification.js
index c13806f..6bf815c 100644
--- a/www/notification.js
+++ b/www/notification.js
@@ -105,6 +105,7 @@ module.exports = {
      * @param {Integer} count       The number of beeps.
      */
     beep: function(count) {
-        exec(null, null, "Notification", "beep", [count]);
+        var defaultedCount = count || 1;
+        exec(null, null, "Notification", "beep", [ defaultedCount ]);
     }
 };


Mime
View raw message