-
Notifications
You must be signed in to change notification settings - Fork 371
Closed
Milestone
Description
To reproduce:
- Use a debug build so you can see errors printed to the console
- Log into an account
- Log out of the account ("Choose account" > three-dots menu > "Log out")
- See the following in the console:
======== Exception caught by widgets library =======================================================
The following _TypeError was thrown building _LoadingPlaceholderPage(dirty, dependencies: [_GlobalStoreInheritedWidget, _LocalizationsScope-[GlobalKey#c7674]], state: _LoadingPlaceholderPageState#4549b):
Null check operator used on a null value
The relevant error-causing widget was:
_LoadingPlaceholderPage _LoadingPlaceholderPage:file:///Users/chrisbobbe/dev/zulip-flutter/lib/widgets/home.dart:36:31
When the exception was thrown, this was the stack:
#0 _LoadingPlaceholderPageState.build (package:zulip/widgets/home.dart:184:36)
#1 StatefulElement.build (package:flutter/src/widgets/framework.dart:5841:27)
#2 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5733:15)
#3 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5892:11)
#4 Element.rebuild (package:flutter/src/widgets/framework.dart:5445:7)
#5 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:5715:5)
#6 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:5883:11)
#7 ComponentElement.mount (package:flutter/src/widgets/framework.dart:5709:5)
This is a latent bug introduced in a97ac42 (fyi @PIG208). This widget shouldn't assume that an account for its accountId param exists; in particular, it won't exist in the short period after the account is removed from the database (for logout) and before routeToRemoveOnLogout is processed in a post-frame callback.
I see two plausible fixes:
- Remove the
accountIdparam and pass…hmm, I guess arealmUrlparam, for the "try another account" message. Or: - Keep the
accountIdparam but give it dartdoc with a reminder that the corresponding account might not exist, saying why.
In either case we should add a test that would fail before the fix but passes after it.
gnprice
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done