bishopmatthew / HackerNews

An open source Hacker News client for Android.
230 stars 61 forks source link

How to better handle mUsername and mPage being `null` #48

Closed pkillian closed 10 years ago

pkillian commented 10 years ago

Currently, we're getting a fair amount of errors when mUsername and mPage are both set to null and StoryLoader is initialized. A RuntimeException is being thrown, which then fails through and crashes the app. A more sane handling of this situation may include canceling the async load, popping up a toast message, etc.

Thoughts on the matter would be much appreciated. I'm not 100% sure I understand how StoryLoader could get initialized without either mUsername or mPage being set.

pkillian commented 10 years ago

Merging to add to this solution