Fix crashes when launching stale or impossibly timed Reading activities.

This commit is contained in:
dosiecki 2015-11-30 09:45:21 -08:00
parent 6aca84919f
commit 625b7a7642
2 changed files with 3 additions and 0 deletions

View file

@ -15,6 +15,8 @@ public class FeedReading extends Reading {
super.onCreate(savedInstanceBundle);
Feed feed = FeedUtils.dbHelper.getFeed(fs.getSingleFeed());
if (feed == null) finish(); // don't open fatally stale intents
Classifier classifier = FeedUtils.dbHelper.getClassifierForFeed(feed.feedId);
UIUtils.setCustomActionBar(this, feed.faviconUrl, feed.title);

View file

@ -19,6 +19,7 @@ public class SocialFeedReading extends Reading {
super.onCreate(savedInstanceBundle);
ignoreFilters = getIntent().hasExtra(EXTRA_IGNORE_FILTERS);
SocialFeed socialFeed = FeedUtils.dbHelper.getSocialFeed(fs.getSingleSocialFeed().getKey());
if (socialFeed == null) finish(); // don't open fatally stale intents
UIUtils.setCustomActionBar(this, socialFeed.photoUrl, socialFeed.feedTitle);
readingAdapter = new MixedFeedsReadingAdapter(getFragmentManager(), defaultFeedView, socialFeed.userId);
getLoaderManager().initLoader(0, null, this);