Merge pull request #847 from TomHennen/fix_npes
Fix NullPointerExceptions
This commit is contained in:
commit
01de68003a
|
@ -120,7 +120,8 @@ public class FeedInfoActivity extends ActionBarActivity {
|
|||
});
|
||||
|
||||
txtvTitle.setText(feed.getTitle());
|
||||
txtvDescription.setText(feed.getDescription().trim());
|
||||
String description = feed.getDescription();
|
||||
txtvDescription.setText((description != null) ? description.trim() : "");
|
||||
if (feed.getAuthor() != null) {
|
||||
txtvAuthor.setText(feed.getAuthor());
|
||||
}
|
||||
|
|
|
@ -365,10 +365,12 @@ public class MainActivity extends ActionBarActivity implements NavDrawerActivity
|
|||
return -1;
|
||||
} else { // last fragment was not a list, but a feed
|
||||
long feedId = Long.parseLong(lastFragment);
|
||||
List<Feed> feeds = navDrawerData.feeds;
|
||||
for (int i = 0; i < feeds.size(); i++) {
|
||||
if (feeds.get(i).getId() == feedId) {
|
||||
return i + navAdapter.getSubscriptionOffset();
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue