Skip to content

Commit

Permalink
Handle null better
Browse files Browse the repository at this point in the history
  • Loading branch information
hansemannn committed Sep 24, 2017
1 parent 9c3da53 commit 1ca5c91
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ios/Classes/TiBluetoothCentralManagerProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ - (void)centralManager:(CBCentralManager *)central didFailToConnectPeripheral:(C
[self fireEvent:@"didFailToConnectPeripheral"
withObject:@{
@"peripheral" : [self peripheralProxyFromPeripheral:peripheral],
@"error" : [error localizedDescription] ?: [NSNull null]
@"error" : NULL_IF_NIL([error localizedDescription])
}];
}
}
Expand Down
4 changes: 2 additions & 2 deletions ios/Classes/TiBluetoothPeripheralManagerProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ - (void)peripheralManagerDidStartAdvertising:(CBPeripheralManager *)peripheral e
[self fireEvent:@"didStartAdvertising"
withObject:@{
@"success" : NUMBOOL(error == nil),
@"error" : [error localizedDescription] ?: [NSNull null]
@"error" : NULL_IF_NIL([error localizedDescription])
}];
}
}
Expand All @@ -238,7 +238,7 @@ - (void)peripheralManager:(CBPeripheralManager *)peripheral didAddService:(CBSer
[self fireEvent:@"didAddService"
withObject:@{
@"service" : [[TiBluetoothServiceProxy alloc] _initWithPageContext:[self pageContext] andService:service],
@"error" : [error localizedDescription] ?: [NSNull null]
@"error" : NULL_IF_NIL([error localizedDescription])
}];
}
}
Expand Down
10 changes: 5 additions & 5 deletions ios/Classes/TiBluetoothPeripheralProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ - (void)peripheral:(CBPeripheral *)peripheral didDiscoverServices:(NSError *)err
[self fireEvent:@"didDiscoverServices"
withObject:@{
@"peripheral" : [self peripheralProxyFromPeripheral:peripheral],
@"error" : [error localizedDescription] ?: [NSNull null]
@"error" : NULL_IF_NIL([error localizedDescription])
}];
}
}
Expand All @@ -241,7 +241,7 @@ - (void)peripheral:(CBPeripheral *)peripheral didUpdateNotificationStateForChara
[self fireEvent:@"didUpdateNotificationStateForCharacteristic"
withObject:@{
@"characteristic" : [self characteristicProxyFromCharacteristic:characteristic],
@"error" : [error localizedDescription] ?: [NSNull null]
@"error" : NULL_IF_NIL([error localizedDescription])
}];
}
}
Expand All @@ -253,7 +253,7 @@ - (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForServi
withObject:@{
@"peripheral" : [self peripheralProxyFromPeripheral:peripheral],
@"service" : [[TiBluetoothServiceProxy alloc] _initWithPageContext:[self pageContext] andService:service],
@"error" : [error localizedDescription] ?: [NSNull null]
@"error" : NULL_IF_NIL([error localizedDescription])
}];
}
}
Expand All @@ -265,7 +265,7 @@ - (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(C
withObject:@{
@"peripheral" : [self peripheralProxyFromPeripheral:peripheral],
@"characteristic" : [self characteristicProxyFromCharacteristic:characteristic],
@"error" : [error localizedDescription] ?: [NSNull null]
@"error" : NULL_IF_NIL([error localizedDescription])
}];
}
}
Expand All @@ -277,7 +277,7 @@ - (void)peripheral:(CBPeripheral *)peripheral didWriteValueForCharacteristic:(CB
withObject:@{
@"peripheral" : [self peripheralProxyFromPeripheral:peripheral],
@"characteristic" : [self characteristicProxyFromCharacteristic:characteristic],
@"error" : [error localizedDescription] ?: [NSNull null]
@"error" : NULL_IF_NIL([error localizedDescription])
}];
}
}
Expand Down

0 comments on commit 1ca5c91

Please sign in to comment.