Skip to content

Commit

Permalink
Merge pull request #89 from arthurdenner/fix/crash-details-sidebar-close
Browse files Browse the repository at this point in the history
fix: prevent crash when closing version details sidebar
  • Loading branch information
leoafarias authored Jun 10, 2021
2 parents 06d303a + 19e165e commit a17e3e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/src/components/organisms/info_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class SelectedDetailDrawer extends HookWidget {
@override
Widget build(BuildContext context) {
final detail = useProvider(selectedDetailProvider).state;

final selected = detail.release;
final selected = detail?.release;

void onClose() {
// Close drawer if its not large layout
Expand Down
2 changes: 1 addition & 1 deletion lib/src/modules/common/app_shell.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class AppShell extends HookWidget {
useValueChanged(selectedInfo, (_, __) {
if (_scaffoldKey.currentState == null) return;
final isOpen = _scaffoldKey.currentState.isEndDrawerOpen;
final hasInfo = selectedInfo.release != null;
final hasInfo = selectedInfo?.release != null;

// Open drawer if not large layout and its not open
if (hasInfo && !isOpen) {
Expand Down

0 comments on commit a17e3e4

Please sign in to comment.