Merge "SQLiteCursor must be closed before throwing exception" into rvc-dev am: 2d3f5ecd4a

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/11983925

Change-Id: I47f121643c93d9ae4934bf1f537c45ea11101c32
This commit is contained in:
TreeHugger Robot
2020-06-24 12:47:36 +00:00
committed by Automerger Merge Worker

View File

@@ -127,10 +127,12 @@ public class SlicesDatabaseAccessor {
int numResults = resultCursor.getCount();
if (numResults == 0) {
resultCursor.close();
throw new IllegalStateException("Invalid Slices key from path: " + path);
}
if (numResults > 1) {
resultCursor.close();
throw new IllegalStateException(
"Should not match more than 1 slice with path: " + path);
}