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

Commit 68d26be7 authored by Henrik Baard's avatar Henrik Baard
Browse files

Early return in RemoteViewsAdapter is too late

The constuctor RemoteViewsAdapter implements an early
return throwing an exception if intent is null.
However the intent is used before it is checked.

Moving early return before use of the intent.

Change-Id: If847245b3b9f21111805f301717080c81474cad7
parent a58336f6
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -817,12 +817,12 @@ public class RemoteViewsAdapter extends BaseAdapter implements Handler.Callback
        mContext = context;
        mIntent = intent;

        mAppWidgetId = intent.getIntExtra(RemoteViews.EXTRA_REMOTEADAPTER_APPWIDGET_ID, -1);

        mLayoutInflater = LayoutInflater.from(context);
        if (mIntent == null) {
            throw new IllegalArgumentException("Non-null Intent must be specified.");
        }

        mAppWidgetId = intent.getIntExtra(RemoteViews.EXTRA_REMOTEADAPTER_APPWIDGET_ID, -1);
        mLayoutInflater = LayoutInflater.from(context);
        mRequestedViews = new RemoteViewsFrameLayoutRefSet();

        // Strip the previously injected app widget id from service intent