Skip to content

Commit

Permalink
[PasswordStrengthBar] Fixes NullPointerException
Browse files Browse the repository at this point in the history
An issue occurring when restoring a saved instance where the user did not set a password, so the `strength` variable was null
  • Loading branch information
OffRange committed Apr 10, 2023
1 parent 4429461 commit c9a024b
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ protected void onRestoreInstanceState(Parcelable state) {
SavedState ss = (SavedState) state;
super.onRestoreInstanceState(ss.getSuperState());
strength = ss.strength;
if(strength == null)
return;

progressIndicator.setIndicatorColor(strength.getColor(getContext()));

strengthText.setVisibility(progressIndicator.getProgress() == 0 ? GONE : VISIBLE);
Expand Down

0 comments on commit c9a024b

Please sign in to comment.