In the stock list, filter out any symbols that have not yet been fetched
If you load the example and immediately switch to the Portfolio tab, you may see exceptions due to symbols that are in the portfolio list but whose data is not yet present in the stocks map
This commit is contained in:
@@ -175,7 +175,8 @@ class StockHomeState extends State<StockHome> {
|
||||
int selectedTabIndex = 0;
|
||||
|
||||
Iterable<Stock> _getStockList(Iterable<String> symbols) {
|
||||
return symbols.map((String symbol) => config.stocks[symbol]);
|
||||
return symbols.map((String symbol) => config.stocks[symbol])
|
||||
.where((Stock stock) => stock != null);
|
||||
}
|
||||
|
||||
Iterable<Stock> _filterBySearchQuery(Iterable<Stock> stocks) {
|
||||
|
||||
Reference in New Issue
Block a user