Merge "SQLiteCursor must be closed before throwing exception" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
2d3f5ecd4a
@@ -127,10 +127,12 @@ public class SlicesDatabaseAccessor {
|
|||||||
int numResults = resultCursor.getCount();
|
int numResults = resultCursor.getCount();
|
||||||
|
|
||||||
if (numResults == 0) {
|
if (numResults == 0) {
|
||||||
|
resultCursor.close();
|
||||||
throw new IllegalStateException("Invalid Slices key from path: " + path);
|
throw new IllegalStateException("Invalid Slices key from path: " + path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (numResults > 1) {
|
if (numResults > 1) {
|
||||||
|
resultCursor.close();
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"Should not match more than 1 slice with path: " + path);
|
"Should not match more than 1 slice with path: " + path);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user