Skip to content

Commit cd1c5f0

Browse files
JulianKastJulian Kast
andauthored
Add NPE check in BaseChoiceSetManager (#1666)
Co-authored-by: Julian Kast <julian@livio.com>
1 parent b54d551 commit cd1c5f0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

base/src/main/java/com/smartdevicelink/managers/screen/choiceset/BaseChoiceSetManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,14 +348,14 @@ private void sendPresentOperation(KeyboardListener keyboardListener, Interaction
348348
ChoiceSetSelectionListener privateChoiceListener = new ChoiceSetSelectionListener() {
349349
@Override
350350
public void onChoiceSelected(ChoiceCell choiceCell, TriggerSource triggerSource, int rowIndex) {
351-
if (pendingPresentationSet.getChoiceSetSelectionListener() != null) {
351+
if (pendingPresentationSet != null && pendingPresentationSet.getChoiceSetSelectionListener() != null) {
352352
pendingPresentationSet.getChoiceSetSelectionListener().onChoiceSelected(choiceCell, triggerSource, rowIndex);
353353
}
354354
}
355355

356356
@Override
357357
public void onError(String error) {
358-
if (pendingPresentationSet.getChoiceSetSelectionListener() != null) {
358+
if (pendingPresentationSet != null && pendingPresentationSet.getChoiceSetSelectionListener() != null) {
359359
pendingPresentationSet.getChoiceSetSelectionListener().onError(error);
360360
}
361361
}

0 commit comments

Comments
 (0)