Skip to content

Commit a1fbaa6

Browse files
author
Julian Kast
committed
Fixed potential NPE and removed log statement
1 parent 4bc9c5e commit a1fbaa6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

base/src/main/java/com/smartdevicelink/managers/screen/BaseSubscribeButtonManager.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ public void start(CompletionListener listener) {
4848
@Override
4949
public void dispose() {
5050
super.dispose();
51-
onButtonListeners.clear();
51+
if (onButtonListeners != null) {
52+
onButtonListeners.clear();
53+
}
5254
internalInterface.removeOnRPCNotificationListener(FunctionID.ON_BUTTON_PRESS, onButtonPressListener);
5355
internalInterface.removeOnRPCNotificationListener(FunctionID.ON_BUTTON_EVENT, onButtonEventListener);
5456
}
@@ -96,7 +98,7 @@ void removeButtonListener(final ButtonName buttonName, final OnButtonListener li
9698

9799
if (buttonName == null) {
98100
listener.onError("ButtonName cannot be null");
99-
Log.e(TAG, "ButtonName cannot be null");
101+
return;
100102
}
101103

102104
if (onButtonListeners.get(buttonName) == null || !onButtonListeners.get(buttonName).contains(listener)) {

0 commit comments

Comments
 (0)