Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
Prevent NPE if not a GATT characteristic
Browse files Browse the repository at this point in the history
Signed-off-by: Kai Kreuzer <kai@openhab.org>
  • Loading branch information
kaikreuzer committed Jan 9, 2018
1 parent 93d2da4 commit b0ae2e0
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ public void handleCommand(ChannelUID channelUID, Command command) {
// Handle REFRESH
if (command == RefreshType.REFRESH) {
for (BluetoothCharacteristic characteristic : deviceCharacteristics) {
if (channelUID.getId().equals(characteristic.getGattCharacteristic().name())) {
if (characteristic.getGattCharacteristic() != null
&& channelUID.getId().equals(characteristic.getGattCharacteristic().name())) {
device.readCharacteristic(characteristic);
break;
}
Expand Down

0 comments on commit b0ae2e0

Please sign in to comment.