Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 48eca3fd authored by Katherine Kuan's avatar Katherine Kuan
Browse files

Fix NPE in ContactDetailUpdatesFragment

setData() is getting called before onViewCreated() in the
fragment, so check if the adaper has been initialized or
not before trying to set the stream items to it.

Bug: 5153519
Change-Id: I4a65f4713f7cd9cfc1a6fad494fb65a1f1352b1f
parent 0d39c554
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -131,8 +131,14 @@ public class ContactDetailUpdatesFragment extends ListFragment
        }
        mLookupUri = lookupUri;
        mContactData = result;

        // If the adapter has been created already, then try to set stream items. Otherwise,
        // wait for the adapter to get initialized, after which we will try to set the stream items
        // again.
        if (mStreamItemAdapter != null) {
            mStreamItemAdapter.setStreamItems(mContactData.getStreamItems());
        }
    }

    @Override
    public void setAlphaLayerValue(float alpha) {