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

Commit 24dfdc86 authored by Valentin Iftime's avatar Valentin Iftime
Browse files

Prevent NPE in MessagingImageMessage

 Add check for null drawable in case it was recycled
 before getMeasuredType.

Test: manual
Bug: 238485748
Change-Id: I3e465f9b8287f727c56fd45cd339dada005364f2
parent c3550fca
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -198,6 +198,11 @@ public class MessagingImageMessage extends ImageView implements MessagingMessage

    @Override
    public int getMeasuredType() {
        if (mDrawable == null) {
            Log.e(TAG, "getMeasuredType() after recycle()!");
            return MEASURED_NORMAL;
        }

        int measuredHeight = getMeasuredHeight();
        int minImageHeight;
        if (mIsIsolated) {