Fix issues detected by null safety

This commit is contained in:
Vishesh Handa
2021-06-02 12:08:54 +02:00
parent 16fad3b98c
commit fb1b116947
6 changed files with 17 additions and 21 deletions

View File

@ -161,7 +161,10 @@ class GitHub implements GitHost {
throw GitHostException.MissingAccessCode;
}
var userInfo = await (getUserInfo() as FutureOr<UserInfo>);
var userInfo = await getUserInfo();
if (userInfo == null) {
throw Exception("GitHub UserInfo not found. This is bad");
}
var owner = userInfo.username;
var url = Uri.parse("https://api.github.com/repos/$owner/$name");