Skip to content

Commit

Permalink
Fix Camera.getPicture when options are not passed.
Browse files Browse the repository at this point in the history
  • Loading branch information
agrieve committed Sep 27, 2012
1 parent 620cb28 commit 968764b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/common/plugin/Camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ for (var key in Camera) {
* @param {Object} options
*/
cameraExport.getPicture = function(successCallback, errorCallback, options) {
options = options || {};
// successCallback required
if (typeof successCallback != "function") {
console.log("Camera Error: successCallback is not a function");
Expand All @@ -53,9 +54,9 @@ cameraExport.getPicture = function(successCallback, errorCallback, options) {
}

var quality = 50;
if (options && typeof options.quality == "number") {
if (typeof options.quality == "number") {
quality = options.quality;
} else if (options && typeof options.quality == "string") {
} else if (typeof options.quality == "string") {
var qlity = parseInt(options.quality, 10);
if (isNaN(qlity) === false) {
quality = qlity.valueOf();
Expand Down

0 comments on commit 968764b

Please sign in to comment.