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