From b6a2d5f508d37b0331d8e8bd0553f7172a3e395f Mon Sep 17 00:00:00 2001 From: Xavier Sellier Date: Fri, 4 May 2018 23:11:16 -0400 Subject: [PATCH] Closing the app might lead to a crash due to an IllegalArgumentException --- .../org/godotengine/godot/payments/PaymentsManager.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java b/platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java index 89216cd12b6..bdfbee155ae 100644 --- a/platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java +++ b/platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java @@ -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;