NPE will be occurred when clients gives invalid slice uri for Settings.
We have defined some rules in getPathData() and it will return null
object when the invalid uri was given. NPE will be happened in next.
Change-Id: I6ebadd4383aee6e69b1c2eb6c84071c961fd72a7
Fixes:
120259627
Test: robotests
*/
public SliceData getSliceDataFromUri(Uri uri) {
Pair<Boolean, String> pathData = SliceBuilderUtils.getPathData(uri);
+ if (pathData == null) {
+ throw new IllegalStateException("Invalid Slices uri: " + uri);
+ }
Cursor cursor = getIndexedSliceData(pathData.second /* key */);
return buildSliceData(cursor, uri, pathData.first /* isIntentOnly */);
}