pd4d10 / git-touch

An open-source app for GitHub, GitLab, Bitbucket, Gitea, and Gitee(码云), built with Flutter
Apache License 2.0
1.56k stars 137 forks source link

Error displaying repo with 0 files #99

Closed shreyas1599 closed 3 years ago

shreyas1599 commented 4 years ago

An error occurs (see image below) when the repo is initialized with zero files. I created a public repo - test to confirm this was not only caused for private repos(I found the problem while opening a private repo). The error is caused by fetchContributors. For example: https://api.github.com/repos/shreyas1599/test/stats/contributors does nothing. Does not even return an error message. I tried using the debugger and it returned an exception on this line of github.dart of SpinlockLabs.

I'm thinking there's no response and jsonDecode is throwing an error because nothing is returned by the request. Could this be the error or am I missing something?

image

pd4d10 commented 3 years ago

I'm thinking there's no response and jsonDecode is throwing an error because nothing is returned by the request

Yeah, it seems so. Perhaps we should manually catch this error in this case.