Merge "Fix NPE when coming back to settings homepage." into rvc-dev am: 21338186d5
Change-Id: I5cf0e713e0016b1463ba7e7e39628adc3cc407c2
This commit is contained in:
@@ -120,6 +120,11 @@ public class SliceContextualCardRenderer implements ContextualCardRenderer, Life
|
|||||||
swipeBackground.setVisibility(View.GONE);
|
swipeBackground.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
sliceLiveData.observe(mLifecycleOwner, slice -> {
|
sliceLiveData.observe(mLifecycleOwner, slice -> {
|
||||||
|
if (slice == null) {
|
||||||
|
// The logic handling this case is in OnErrorListener. Adding this check is to
|
||||||
|
// prevent from NPE when it calls .hasHint().
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (slice.hasHint(HINT_ERROR)) {
|
if (slice.hasHint(HINT_ERROR)) {
|
||||||
Log.w(TAG, "Slice has HINT_ERROR, skipping rendering. uri=" + slice.getUri());
|
Log.w(TAG, "Slice has HINT_ERROR, skipping rendering. uri=" + slice.getUri());
|
||||||
mSliceLiveDataMap.get(slice.getUri()).removeObservers(mLifecycleOwner);
|
mSliceLiveDataMap.get(slice.getUri()).removeObservers(mLifecycleOwner);
|
||||||
|
Reference in New Issue
Block a user