diff --git a/CHANGELOG.md b/CHANGELOG.md index 04f16c6..fab48b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 4.0.2 - 2016-07-09 +- Check for null parameters, mainly applies to startScan which doesn't necessarily require parameters +- Don't try to stop scan if already stopped + +## 4.0.1 - 2016-04-17 +- Minor fixes to support npm + ## 4.0.0 - 2016-03-30 - Merged server side functions @@ -17,5 +24,4 @@ - Sync Angular wrapper's and Cordova plugin's version numbers - Timeouts available on most functions - Example updated with queueing example -- Removed build generation. App build process can handle minification. - +- Removed build generation. App build process can handle minification \ No newline at end of file diff --git a/bower.json b/bower.json index f718dfd..314ac08 100755 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "ng-cordova-bluetoothle", "main": "./ng-cordova-bluetoothle.js", - "version": "4.0.0", + "version": "4.0.2", "description": "AngularJS Wrapper for Phonegap / Cordova Bluetooth LE Plugin", "authors": [ "George Stocker ", diff --git a/ng-cordova-bluetoothle.js b/ng-cordova-bluetoothle.js index 2ee1726..d493ac5 100644 --- a/ng-cordova-bluetoothle.js +++ b/ng-cordova-bluetoothle.js @@ -59,7 +59,7 @@ angular.module('ngCordovaBluetoothLE', []).factory('$cordovaBluetoothLE', ['$q', q.reject(errorUnsupported); } else { var timeout = null; - if (params.scanTimeout) { + if (params && params.scanTimeout) { timeout = $timeout(function() { window.bluetoothle.isScanning(function(obj) { if (obj.isScanning) { @@ -136,7 +136,7 @@ angular.module('ngCordovaBluetoothLE', []).factory('$cordovaBluetoothLE', ['$q', window.bluetoothle.connect( function(obj) { $timeout.cancel(timeout); - if (params.useResolve) { + if (params && params.useResolve) { q.resolve(obj); } else { q.notify(obj); @@ -162,7 +162,7 @@ angular.module('ngCordovaBluetoothLE', []).factory('$cordovaBluetoothLE', ['$q', window.bluetoothle.reconnect( function(obj) { $timeout.cancel(timeout); - if (params.useResolve) { + if (params && params.useResolve) { q.resolve(obj); } else { q.notify(obj); @@ -336,7 +336,7 @@ angular.module('ngCordovaBluetoothLE', []).factory('$cordovaBluetoothLE', ['$q', $timeout.cancel(timeout); q.notify(obj); - if (params.subscribeTimeout && obj.status == "subscribed") { + if (params && params.subscribeTimeout && obj.status == "subscribed") { $timeout(function() { window.bluetoothle.unsubscribe( function(obj) { @@ -898,7 +898,7 @@ angular.module('ngCordovaBluetoothLE', []).factory('$cordovaBluetoothLE', ['$q', }; var createTimeout = function(params, q) { - if (params.timeout) { + if (params && params.timeout) { return $timeout(function() { params.error = "timeout"; q.reject(params); diff --git a/package.json b/package.json index 70fcf18..2344e72 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ng-cordova-bluetoothle", - "version": "4.0.1", + "version": "4.0.2", "description": "AngularJS Wrapper for Phonegap / Cordova Bluetooth LE Plugin", "author": { "name": "George Stocker",