You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Make GitHub trending parser resilient to per-row parse failures (#39)
parseTrendingItem() never actually returned null despite being called
via mapNotNull — any exception from a single malformed repo card
(unusual href structure, missing star/fork markup, non-numeric count
text) propagated straight out of parse() and failed the whole trending
fetch, surfacing as the generic "Something went wrong" error for the
entire tab even when most rows were parseable.
Wrap the per-item parsing in try/catch so a bad row is skipped and
logged instead of taking down the whole list, and use toIntOrNull
instead of toInt so a non-numeric star/fork count no longer throws.
Also stop crashing on a missing star count (previously counts[0])
now that GithubTrendingResponseItem.stars is properly optional, and
fix the "likes" text showing a literal "★ null" when it's absent.
Co-authored-by: Claude <noreply@anthropic.com>