pd4d10 / git-touch

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

GitHub files page error #182

Closed shreyas1599 closed 3 years ago

shreyas1599 commented 3 years ago

I noticed this a while back. Forgot to get to it. Opening an issue in case I forget again.

Screenshot_20210201-205829.png

shreyas1599 commented 3 years ago

This seems to be a problem of HighlightView. This is the offending line. When patch is null as is the case with the above screenshot, the error occurs.

shreyas1599 commented 3 years ago

I can catch it in files_item.dart itself but I think it would be better for the package to handle null.

shreyas1599 commented 3 years ago

I'm thinking of replacing this line with patch ?? "No text to be shown here" or should I just leave it as an empty string. I think the first option is better because github returns a null patch only if the file has binary data. What do you think @pd4d10 ?

pd4d10 commented 3 years ago

OK. I have no strong preference for this, as long as it is easy to understand for users.