Skip to content

Commit 85917ab

Browse files
committed
Handle calling List.from with null
1 parent a4f0751 commit 85917ab

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 6.0.5
2+
- Fix null errors issue https://github.com/SpinlockLabs/github.dart/issues/199
3+
14
## 6.0.4
25
- This fixes #196 (https://github.com/SpinlockLabs/github.dart/issues/196)
36

lib/src/common/github.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,9 @@ class GitHub {
387387
if (response.headers['content-type'].contains('application/json')) {
388388
final json = jsonDecode(response.body);
389389
message = json['message'];
390-
errors = List<Map<String, String>>.from(json['errors']);
390+
if (json['errors'] != null) {
391+
errors = List<Map<String, String>>.from(json['errors']);
392+
}
391393
}
392394
switch (response.statusCode) {
393395
case 404:

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: github
2-
version: 6.0.4
2+
version: 6.0.5
33
description: A high-level GitHub API Client Library that uses Github's v3 API
44
homepage: https://github.com/SpinlockLabs/github.dart
55

0 commit comments

Comments
 (0)