mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
Handle case where no page can be found
Note that this shouldn't actually happen, we should find a proper solution
This commit is contained in:
@@ -71,11 +71,15 @@ class _LogPageState extends ConsumerState<LogPage> {
|
||||
final theme = Theme.of(context);
|
||||
final state = ref.watch(gymStateProvider);
|
||||
|
||||
final page = state.getPageByIndex()!;
|
||||
final slotEntryPage = state.getSlotEntryPageByIndex();
|
||||
final page = state.getPageByIndex();
|
||||
if (page == null) {
|
||||
widget._logger.warning('getPageByIndex returned null, showing empty container');
|
||||
return Container();
|
||||
}
|
||||
|
||||
final slotEntryPage = state.getSlotEntryPageByIndex();
|
||||
if (slotEntryPage == null) {
|
||||
widget._logger.finer('getSlotPageByIndex returned null, showing empty container');
|
||||
widget._logger.warning('getSlotPageByIndex returned null, showing empty container');
|
||||
return Container();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user