From 87386193ee41a22f5c07da29cd321840e8b2a812 Mon Sep 17 00:00:00 2001 From: Andrew Golovashevich Date: Thu, 20 Mar 2025 02:41:03 +0300 Subject: [PATCH] [history] Fixed error when 'onCrossReturn' and 'onSuccess' called together --- .../utility/highlevel_try_finally/safe_autoclose.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/utility/highlevel_try_finally/safe_autoclose.kt b/src/commonMain/kotlin/ru/landgrafhomyak/utility/highlevel_try_finally/safe_autoclose.kt index 4bfdc95..14c50cf 100644 --- a/src/commonMain/kotlin/ru/landgrafhomyak/utility/highlevel_try_finally/safe_autoclose.kt +++ b/src/commonMain/kotlin/ru/landgrafhomyak/utility/highlevel_try_finally/safe_autoclose.kt @@ -90,7 +90,8 @@ inline fun safeAutoClose3e( if (!wasError) { if (crossReturned) onCrossReturn() - onSuccess() + else + onSuccess() } } return ret