diff options
author | Chris Schlaeger <chris@linux.com> | 2017-08-29 21:48:21 +0200 |
---|---|---|
committer | Chris Schlaeger <chris@linux.com> | 2017-08-29 21:48:21 +0200 |
commit | ed64a746043be3e1ea36255a6488568b3fb7cee0 (patch) | |
tree | 369b33a324477bdbc153cebf1bfc6779af83b683 | |
parent | 5271a7a1e2368c9d49f26a4482edef6e9715a3be (diff) | |
download | postrunner-ed64a746043be3e1ea36255a6488568b3fb7cee0.zip |
Fix: Don't crash when BluetoothLE sensors were used.
-rw-r--r-- | lib/postrunner/DataSources.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/postrunner/DataSources.rb b/lib/postrunner/DataSources.rb index 3db5547..29cd1e4 100644 --- a/lib/postrunner/DataSources.rb +++ b/lib/postrunner/DataSources.rb @@ -75,8 +75,12 @@ module PostRunner def device_name(index) @fit_activity.device_infos.each do |device| if device.device_index == index - return (DeviceList::DeviceTypeNames[device.device_type] || - device.device_type) + " [#{device.device_index}]" + if device.device_type + return (DeviceList::DeviceTypeNames[device.device_type] || + device.device_type) + " [#{device.device_index}]" + else + return "Unknown [#{device.device_index}]" + end end end |