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

Commit 779398e7 authored by Romain Guy's avatar Romain Guy
Browse files

Fixes a potential NPE in View.

Calling getLocationOnScreen() before the View is attached to a window can
throw an NPE. This change simply guards against the exception.
parent a6061e04
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -7157,9 +7157,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
        getLocationInWindow(location);

        final AttachInfo info = mAttachInfo;
        if (info != null) {
            location[0] += info.mWindowLeft;
            location[1] += info.mWindowTop;
        }
    }

    /**
     * <p>Computes the coordinates of this view in its window. The argument