SimonHalvdansson / Harmonic-HN

Modern Android client for Hacker News
https://play.google.com/store/apps/details?id=com.simon.harmonichackernews
Apache License 2.0
620 stars 39 forks source link

fix exception when loading user without submissions #9

Closed Tukajo closed 1 year ago

Tukajo commented 1 year ago

This pull request is to fix an issue with users that do not have a "submissions" key.

If you look at the response for my username, https://hacker-news.firebaseio.com/v0/user/tukajo.json

It returns the following JSON

{"created":1650837729,"id":"tukajo","karma":1}

This causes an exception to be thrown when the getJsonArray is called, which causes the modal to never be able to render the user profile (no matter how many retries).

Addresses #10

SimonHalvdansson commented 1 year ago

This looks like a very good nice straightforward catch, thanks! :)