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

Commit f5126647 authored by Anthony Newnam's avatar Anthony Newnam
Browse files

Don't allow invalid Uris to be added as observers.

If a null segment is added, it will cause problems traversing the list
at a later point.

Change-Id: I5aa97b969cac7231e214168af7d3263b1c16f0a0
parent 1152df7e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -496,6 +496,9 @@ public final class ContentService extends IContentService.Stub {

            // Look to see if the proper child already exists
            String segment = getUriSegment(uri, index);
            if (segment == null) {
                throw new IllegalArgumentException("Invalid Uri (" + uri + ") used for observer");
            }
            int N = mChildren.size();
            for (int i = 0; i < N; i++) {
                ObserverNode node = mChildren.get(i);