Skip to content

Commit

Permalink
Check for null values
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosinigaglia committed Jul 24, 2018
1 parent 822894f commit 7ab17fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion android/src/main/java/it/innove/Peripheral.java
Expand Up @@ -176,7 +176,9 @@ public WritableMap asWritableMap() {
WritableMap serviceData = Arguments.createMap();
if (advertisingData.getServiceData() != null) {
for (Map.Entry<ParcelUuid, byte[]> entry : advertisingData.getServiceData().entrySet()) {
serviceData.putMap(UUIDHelper.uuidToString(((ParcelUuid) entry.getKey()).getUuid()), byteArrayToWritableMap((byte[]) entry.getValue()));
if (entry.getValue() != null) {
serviceData.putMap(UUIDHelper.uuidToString((entry.getKey()).getUuid()), byteArrayToWritableMap(entry.getValue()));
}
}
}

Expand Down

0 comments on commit 7ab17fb

Please sign in to comment.