From ab86039eaa4c452464fc0e5dbd459fada58e1082 Mon Sep 17 00:00:00 2001 From: Jimmy Huang Date: Tue, 26 Aug 2014 10:52:08 -0700 Subject: [PATCH] Adds sanity check if adapter is invalid Change-Id: Ia4815cc3f5e2349bb02625d97c07ae9b4ca63e2b Signed-off-by: Jimmy Huang --- css/car/components/settings/js/bluetooth.js | 8 ++++++++ packaging/modello-common.changes | 3 +++ 2 files changed, 11 insertions(+) diff --git a/css/car/components/settings/js/bluetooth.js b/css/car/components/settings/js/bluetooth.js index 704747d..3a9a2f8 100644 --- a/css/car/components/settings/js/bluetooth.js +++ b/css/car/components/settings/js/bluetooth.js @@ -481,6 +481,14 @@ Bluetooth.prototype.loadBluetoothConfig = function() { Bluetooth.prototype.getDevice = function(device) { "use strict"; var self = this; + if (!self.adapter()) { + console.log ("Device is null"); + console.log ("removing device:", device.address); + self.removeDevice(device.address); + self.sortDevices(); + self.saveBluetooth(); + } + self.adapter().getDevice(device.address, function(dev) { // console.log("getDevice ", dev); self.addUpdateDevice(dev, false); diff --git a/packaging/modello-common.changes b/packaging/modello-common.changes index ef10285..e527e1d 100644 --- a/packaging/modello-common.changes +++ b/packaging/modello-common.changes @@ -1,3 +1,6 @@ +* Tue Aug 26 2014 Jimmy Huang accepted/tizen/ivi/20140821.133859-1-g65c5429 +- Adds sanity check if adapter is invalid + * Wed Aug 20 2014 Brian Jones accepted/tizen/ivi/20140814.201957-2-g5b6386a - Updating tizen api checks to avoid failure if they don't exist -- 2.7.4