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

Commit 00553835 authored by Jim Miller's avatar Jim Miller Committed by Android (Google) Code Review
Browse files

Merge "Attempt to fix NPE in keyguard" into jb-mr2-dev

parents 83d6df27 982d21b9
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -326,10 +326,15 @@ public class KeyguardHostView extends KeyguardViewBase {
    }

    private int getWidgetPosition(int id) {
        final int children = mAppWidgetContainer.getChildCount();
        final KeyguardWidgetPager appWidgetContainer = mAppWidgetContainer;
        final int children = appWidgetContainer.getChildCount();
        for (int i = 0; i < children; i++) {
            if (mAppWidgetContainer.getWidgetPageAt(i).getContent().getId() == id) {
            final View content = appWidgetContainer.getWidgetPageAt(i).getContent();
            if (content != null && content.getId() == id) {
                return i;
            } else if (content == null) {
                // Attempt to track down bug #8886916
                Log.w(TAG, "*** Null content at " + "i=" + i + ",id=" + id + ",N=" + children);
            }
        }
        return -1;