commit | 3c782f76452fdd5b581b64df06de5fd8c46ca31c | [log] [tgz] |
---|---|---|
author | Sunny Shao <sunnyshao@google.com> | Wed Jun 24 18:11:13 2020 +0800 |
committer | Sunny Shao <sunnyshao@google.com> | Wed Jun 24 18:11:13 2020 +0800 |
tree | c7fbbee2206043605aa53307c67dc03d0a046a33 | |
parent | c9310c3156fda20a89b1b2470d531c7acb175280 [diff] |
SQLiteCursor must be closed before throwing exception Fixes: 159694902 Test: manual test Change-Id: I11b422e90b3155f47f53b4247eacf9f1b424b0ab
diff --git a/src/com/android/settings/slices/SlicesDatabaseAccessor.java b/src/com/android/settings/slices/SlicesDatabaseAccessor.java index e31715d..c0bb8de 100644 --- a/src/com/android/settings/slices/SlicesDatabaseAccessor.java +++ b/src/com/android/settings/slices/SlicesDatabaseAccessor.java
@@ -127,10 +127,12 @@ 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); }