Skip to content

Commit

Permalink
Fix #179: App crashed because of using function HashMap#putIfAbsent w…
Browse files Browse the repository at this point in the history
…hich only available from Android API 24 onwards
  • Loading branch information
JOikarinen committed Aug 10, 2021
1 parent fd87fd3 commit 353310a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ protected void addCharacteristic(final UUID characteristic, int properties) {
if ((properties & PROPERTY_READ) != 0 && !containsCharacteristicRead(characteristic)) {
characteristicsRead.put(characteristic, true);
}
characteristics.putIfAbsent(characteristic, true);
if (!characteristics.containsKey(characteristic)) {
characteristics.put(characteristic, true);
}
}

protected void addAvailableCharacteristic(UUID chr, int property) {
Expand Down

0 comments on commit 353310a

Please sign in to comment.