Skip to content

Commit

Permalink
add null check before fromJson to endpoint_base.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
bvasya committed Aug 19, 2024
1 parent 3022a09 commit 5d54902
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/endpoints/endpoint_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ abstract class EndpointBase {
required T Function(Map<String, dynamic>) fromJson}) async {
var jsonString = await _api._get(path);
final tJson = jsonDecode(jsonString)[jsonKey] as Iterable<dynamic>;
return tJson.map((json) => fromJson(json));
return tJson.where((e) => e != null).map((json) => fromJson(json));
}
}

0 comments on commit 5d54902

Please sign in to comment.