Skip to content

Commit

Permalink
Merge pull request #279 from backbonelabs/fix-null-reference
Browse files Browse the repository at this point in the history
Evaluate err.message only if err exists
  • Loading branch information
miguelc1221 authored Mar 23, 2017
2 parents 4879360 + 42ef1de commit 576dbbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/actions/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const deviceActions = {
payload: () => new Promise((resolve, reject) => {
BluetoothService.getState((err, { state }) => {
if (err || state !== bluetoothStates.ON) {
reject(new Error(err.message || 'Bluetooth is not enabled.'));
reject(new Error((err && err.message) || 'Bluetooth is not enabled.'));
} else {
Mixpanel.trackWithProperties('connectToDevice', {
deviceIdentifier: identifier,
Expand Down

0 comments on commit 576dbbe

Please sign in to comment.