fixed NPE on navDrawerData

This commit is contained in:
Tom Hennen 2015-05-28 17:54:41 -04:00
parent 8ed3f95ec5
commit 9e7bb5ce73
1 changed files with 6 additions and 4 deletions

View File

@ -365,12 +365,14 @@ public class MainActivity extends ActionBarActivity implements NavDrawerActivity
return -1;
} else { // last fragment was not a list, but a feed
long feedId = Long.parseLong(lastFragment);
if (navDrawerData != null) {
List<Feed> feeds = navDrawerData.feeds;
for (int i = 0; i < feeds.size(); i++) {
if (feeds.get(i).getId() == feedId) {
return i + navAdapter.getSubscriptionOffset();
}
}
}
return -1;
}
}