[GH-ISSUE #99] Error displaying repo with 0 files #2517

Closed
opened 2026-05-03 02:15:11 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @shreyas1599 on GitHub (Aug 16, 2020).
Original GitHub issue: https://github.com/pd4d10/git-touch/issues/99

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

Originally created by @shreyas1599 on GitHub (Aug 16, 2020). Original GitHub issue: https://github.com/pd4d10/git-touch/issues/99 An error occurs (see image below) when the repo is initialized with zero files. I created a public repo - [test](https://github.com/shreyas1599/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](https://github.com/git-touch/git-touch/blob/1276957b2d14ad93b3762bb109a457711085d978/lib/screens/gh_repo.dart#L54). 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](https://github.com/SpinlockLabs/github.dart/blob/3c88457815f3013fcbf54032567dca3815f3953e/lib/src/common/github.dart#L278) 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](https://user-images.githubusercontent.com/28999492/90339050-d1f55600-e00b-11ea-821a-e61ca58e71a6.png)
Author
Owner

@pd4d10 commented on GitHub (Oct 3, 2020):

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.

<!-- gh-comment-id:703062874 --> @pd4d10 commented on GitHub (Oct 3, 2020): > 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/git-touch#2517