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

Commit 1ebaff2a authored by Jay Shrauner's avatar Jay Shrauner
Browse files

Check for empty lookup keys in getLookupUri

Bug:19588470
Change-Id: I5379e0b16dbec7692ef86ca8a21b0eae2aa47819
parent 4011e209
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1516,8 +1516,14 @@ public final class ContactsContract {
        /**
         * Build a {@link #CONTENT_LOOKUP_URI} lookup {@link Uri} using the
         * given {@link ContactsContract.Contacts#_ID} and {@link #LOOKUP_KEY}.
         * <p>
         * Returns null if unable to construct a valid lookup URI from the
         * provided parameters.
         */
        public static Uri getLookupUri(long contactId, String lookupKey) {
            if (TextUtils.isEmpty(lookupKey)) {
                return null;
            }
            return ContentUris.withAppendedId(Uri.withAppendedPath(Contacts.CONTENT_LOOKUP_URI,
                    lookupKey), contactId);
        }