Skip to content

Commit

Permalink
don't use _preferences when it's not ready
Browse files Browse the repository at this point in the history
  • Loading branch information
X-Wei committed Jan 13, 2019
1 parent ccd0011 commit 146e108
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/routes/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ class _HomePageState extends State<HomePage> {
}

Widget _buildBookmarksExpansionTile() {
final List<MyRoute> routes =
BookmarkManager.bookmarkedRoutenames(this._preferences)
final List<MyRoute> routes = this._preferences != null
? BookmarkManager.bookmarkedRoutenames(this._preferences)
.map((routename) => kRoutenameToRouteMap[routename])
.where((route) => route != null)
.toList();
.toList()
: [];
MyRouteGroup staredGroup = MyRouteGroup(
groupName: 'Bookmarks',
icon: Icon(Icons.stars),
Expand Down

0 comments on commit 146e108

Please sign in to comment.