Commit 32abb018 authored by Him188's avatar Him188

Fix tryNTimes

parent bcaafbbe
...@@ -24,8 +24,7 @@ inline fun <R> tryNTimes(repeat: Int, block: (Int) -> R): R { ...@@ -24,8 +24,7 @@ inline fun <R> tryNTimes(repeat: Int, block: (Int) -> R): R {
} catch (e: Throwable) { } catch (e: Throwable) {
if (lastException == null) { if (lastException == null) {
lastException = e lastException = e
} } else lastException!!.addSuppressed(e)
lastException!!.addSuppressed(e)
} }
} }
...@@ -43,8 +42,7 @@ inline fun <R> tryNTimesOrNull(repeat: Int, block: (Int) -> R): R? { ...@@ -43,8 +42,7 @@ inline fun <R> tryNTimesOrNull(repeat: Int, block: (Int) -> R): R? {
} catch (e: Throwable) { } catch (e: Throwable) {
if (lastException == null) { if (lastException == null) {
lastException = e lastException = e
} } else lastException!!.addSuppressed(e)
lastException!!.addSuppressed(e)
} }
} }
...@@ -63,8 +61,7 @@ inline fun <R> tryNTimesOrException(repeat: Int, block: (Int) -> R): Throwable? ...@@ -63,8 +61,7 @@ inline fun <R> tryNTimesOrException(repeat: Int, block: (Int) -> R): Throwable?
} catch (e: Throwable) { } catch (e: Throwable) {
if (lastException == null) { if (lastException == null) {
lastException = e lastException = e
} } else lastException!!.addSuppressed(e)
lastException!!.addSuppressed(e)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment