Skip to content

Commit

Permalink
When calling ContentProviderClient.release(), on some devices (such a…
Browse files Browse the repository at this point in the history
…s Oppo), a NullPointerException may occur because the IBinder has already been released.
  • Loading branch information
cpacm committed Oct 24, 2024
1 parent 44aa5cd commit 802824e
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,11 @@ void queryEvents(int policy, int limit, EventDbResult dbResult) {
Logger.e(TAG, t, t.getMessage());
} finally {
if (client != null) {
client.release();
try {
client.release();
} catch (java.lang.NullPointerException e) {
// does nothing, Binder connection already null
}
}
}
}
Expand Down Expand Up @@ -225,7 +229,11 @@ void queryEventsAndDelete(int policy, int limit, EventDbResult dbResult) {
Logger.e(TAG, t, t.getMessage());
} finally {
if (client != null) {
client.release();
try {
client.release();
} catch (java.lang.NullPointerException e) {
// does nothing, Binder connection already null
}
}
}
}
Expand Down

0 comments on commit 802824e

Please sign in to comment.