Skip to content

Commit

Permalink
Fix null updateValue crash on iOS innoveit#288
Browse files Browse the repository at this point in the history
  • Loading branch information
eeynard committed Feb 15, 2018
1 parent 8e3f80b commit ae1eba5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ios/BleManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ - (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(C
[readCallbacks removeObjectForKey:key];
} else {
if (hasListeners) {

[self sendEventWithName:@"BleManagerDidUpdateValueForCharacteristic" body:@{@"peripheral": peripheral.uuidAsString, @"characteristic":characteristic.UUID.UUIDString, @"service":characteristic.service.UUID.UUIDString, @"value": [characteristic.value toArray]}];
[self sendEventWithName:@"BleManagerDidUpdateValueForCharacteristic" body:@{@"peripheral": peripheral.uuidAsString, @"characteristic":characteristic.UUID.UUIDString, @"service":characteristic.service.UUID.UUIDString, @"value": ([characteristic.value length] > 0) ? [characteristic.value toArray] : [NSNull null]}];
}
}
}
Expand Down

0 comments on commit ae1eba5

Please sign in to comment.