closeFeed: add some null pointer checking

This commit is contained in:
Andrew Dolgov 2012-09-10 00:05:19 +04:00
parent aa0711147c
commit 8906cad106

View File

@ -1031,11 +1031,15 @@ public class MainActivity extends CommonActivity implements OnlineServices {
if (m_activeFeed.is_cat) { if (m_activeFeed.is_cat) {
FeedCategoriesFragment cats = (FeedCategoriesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_CATS); FeedCategoriesFragment cats = (FeedCategoriesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_CATS);
if (cats != null) {
cats.setSelectedCategory(null); cats.setSelectedCategory(null);
}
} else { } else {
FeedsFragment feeds = (FeedsFragment) getSupportFragmentManager().findFragmentByTag(FRAG_FEEDS); FeedsFragment feeds = (FeedsFragment) getSupportFragmentManager().findFragmentByTag(FRAG_FEEDS);
if (feeds != null) {
feeds.setSelectedFeed(null); feeds.setSelectedFeed(null);
} }
}
m_activeFeed = null; m_activeFeed = null;