Add check to prevent NPE

This commit is contained in:
misaochan 2018-04-14 20:46:07 +10:00
parent 0d114a66a2
commit f40875eb7d

View file

@ -82,8 +82,11 @@ public class NearbyListFragment extends DaggerFragment {
}
public void updateNearbyListSignificantly() {
adapterFactory.updateAdapterData(getPlaceListFromBundle(bundleForUpdates),
(RVRendererAdapter<Place>) recyclerView.getAdapter());
try {
adapterFactory.updateAdapterData(getPlaceListFromBundle(bundleForUpdates), (RVRendererAdapter<Place>) recyclerView.getAdapter());
} catch (NullPointerException e) {
Timber.e("Null pointer exception from calling recyclerView.getAdapter()");
}
}
private List<Place> getPlaceListFromBundle(Bundle bundle) {