Avoids index of bound exceptions

This commit is contained in:
stom79 2017-11-15 19:02:33 +01:00
parent 733937c6f8
commit 0df7705a2b
2 changed files with 2 additions and 2 deletions

View File

@ -281,7 +281,7 @@ public class DisplayNotificationsFragment extends Fragment implements OnRetrieve
return;
if( notification != null){
//Makes sure the notifications is not already displayed
if( notification.getId() != null && notifications.get(0)!= null
if( notification.getId() != null && notifications != null && notifications.size() > 0 && notifications.get(0)!= null
&& Long.parseLong(notification.getId()) > Long.parseLong(notifications.get(0).getId())) {
//Update the id of the last notification retrieved
MainActivity.lastNotificationId = notification.getId();

View File

@ -291,7 +291,7 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
//New data are available
if (context == null)
return;
if( status.getId() != null && statuses.get(0)!= null
if( status.getId() != null && statuses != null && statuses.size() > 0 && statuses.get(0)!= null
&& Long.parseLong(status.getId()) > Long.parseLong(statuses.get(0).getId())) {
if (type == RetrieveFeedsAsyncTask.Type.HOME) {