Skip to content

Commit 9e5137e

Browse files
xenonnn4wlukstbit
authored andcommitted
fix: crash when showing snackbar after removing deck in widget config
Only anchor to the FAB when it is actually visible; otherwise fall back to default positioning.
1 parent 7946cc7 commit 9e5137e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

AnkiDroid/src/main/java/com/ichi2/widget/deckpicker/DeckPickerWidgetConfig.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ class DeckPickerWidgetConfig :
216216
}
217217

218218
override val baseSnackbarBuilder: SnackbarBuilder = {
219-
anchorView = binding.fabWidgetDeckPicker
219+
anchorView = binding.fabWidgetDeckPicker.takeIf { it.isVisible }
220220
}
221221

222222
/**

0 commit comments

Comments
 (0)