Skip to content

Commit

Permalink
Fixed bug where app crashes when selecting answer in yesornoquestion
Browse files Browse the repository at this point in the history
  • Loading branch information
EunoiaC committed May 11, 2021
1 parent be5d798 commit 3361cba
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ public void onClick(View v) {
no.setChecked(false);
yes.setChecked(true);
buttonClicked = 1;
onAnswerChangedListener.onAnswerChanged(buttonClicked, yes.getText().toString());
if (onAnswerChangedListener != null) {
onAnswerChangedListener.onAnswerChanged(buttonClicked, yes.getText().toString());
}
}
});

Expand All @@ -131,7 +133,9 @@ public void onClick(View v) {
no.setChecked(true);
yes.setChecked(false);
buttonClicked = 2;
onAnswerChangedListener.onAnswerChanged(buttonClicked, no.getText().toString());
if (onAnswerChangedListener != null) {
onAnswerChangedListener.onAnswerChanged(buttonClicked, no.getText().toString());
}
}
});
}
Expand Down

0 comments on commit 3361cba

Please sign in to comment.