这是indexloc提供的服务,不要输入任何密码
Skip to content

Commit 4c5c27b

Browse files
Fixed: Catch IllegalStateException "Broadcast already finished" and any other exceptions thrown while finishing ResultSender
1 parent 99080ba commit 4c5c27b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

app/src/main/java/com/termux/api/util/ResultReturner.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,14 @@ public static void returnData(Object context, final Intent intent, final ResultW
190190
activity.setResult(1);
191191
}
192192
} finally {
193-
if (asyncResult != null) {
194-
asyncResult.finish();
195-
} else if (activity != null) {
196-
activity.finish();
193+
try {
194+
if (asyncResult != null) {
195+
asyncResult.finish();
196+
} else if (activity != null) {
197+
activity.finish();
198+
}
199+
} catch (Exception e) {
200+
Logger.logStackTraceWithMessage(LOG_TAG, "Failed to cleanup", e);
197201
}
198202
}
199203
};

0 commit comments

Comments
 (0)