Skip to content

Commit bfe4570

Browse files
committed
fix bottomsheet null bug in account fragment
1 parent 9e8a8e7 commit bfe4570

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

raveandroid/src/main/java/com/flutterwave/raveandroid/account/AccountFragment.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -365,14 +365,16 @@ public void validateAccountCharge(String pbfPubKey, String flwRef) {
365365

366366
public boolean closeBottomSheetsIfOpen() {
367367
boolean showing = false;
368-
if (bottomSheetBehaviorOTP.getState() == BottomSheetBehavior.STATE_EXPANDED) {
369-
showing = true;
370-
bottomSheetBehaviorOTP.setState(BottomSheetBehavior.STATE_COLLAPSED);
371-
}
368+
if (bottomSheetDialog != null) {
369+
if (bottomSheetBehaviorOTP.getState() == BottomSheetBehavior.STATE_EXPANDED) {
370+
showing = true;
371+
bottomSheetBehaviorOTP.setState(BottomSheetBehavior.STATE_COLLAPSED);
372+
}
372373

373-
if (bottomSheetBehaviorInternetBanking.getState() == BottomSheetBehavior.STATE_EXPANDED) {
374-
showing = true;
375-
bottomSheetBehaviorInternetBanking.setState(BottomSheetBehavior.STATE_COLLAPSED);
374+
if (bottomSheetBehaviorInternetBanking.getState() == BottomSheetBehavior.STATE_EXPANDED) {
375+
showing = true;
376+
bottomSheetBehaviorInternetBanking.setState(BottomSheetBehavior.STATE_COLLAPSED);
377+
}
376378
}
377379
return showing;
378380
}

0 commit comments

Comments
 (0)