[bluetooth.generic] Fix build (#9115)

* use Objects.requireNonNull

Signed-off-by: Connor Petty <mistercpp2000+gitsignoff@gmail.com>
This commit is contained in:
Connor Petty 2020-11-23 23:07:29 -08:00 committed by GitHub
parent fd7aa9f9c1
commit 89e0771884
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,6 +16,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
@ -183,7 +184,7 @@ public class GenericBluetoothHandler extends ConnectedBluetoothHandler {
}
private CharacteristicHandler getCharacteristicHandler(BluetoothCharacteristic characteristic) {
return charHandlers.computeIfAbsent(characteristic, CharacteristicHandler::new);
return Objects.requireNonNull(charHandlers.computeIfAbsent(characteristic, CharacteristicHandler::new));
}
private boolean readCharacteristic(BluetoothCharacteristic characteristic) {