Merge pull request #18623 from xsellier/bugfix/unbind-service-crash

Closing the app might lead to a crash due to an IllegalArgumentException
This commit is contained in:
Juan Linietsky 2018-05-07 11:57:17 -03:00 committed by GitHub
commit 6cdaa2c6c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -193,7 +193,13 @@ public class PaymentsManager {
public void destroy() {
if (mService != null) {
activity.unbindService(mServiceConn);
try {
activity.unbindService(mServiceConn);
} catch (IllegalArgumentException e) {
// Somehow we've already been unbound. This is a non-fatal
// error.
Log.e(TAG, "Unable to unbind from payment service (already unbound)");
}
}
mSetupDone = false;