mirror of
https://github.com/mamoe/mirai.git
synced 2026-09-06 07:04:56 +08:00
Avoid self-suppression
This commit is contained in:
@@ -7,6 +7,9 @@ private var isAddSuppressedSupported: Boolean = true
|
||||
@MiraiInternalAPI
|
||||
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
|
||||
actual fun Throwable.addSuppressed(e: Throwable) {
|
||||
if (this === e) {
|
||||
return
|
||||
}
|
||||
if (!isAddSuppressedSupported) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -5,6 +5,9 @@ private var isAddSuppressedSupported: Boolean = true
|
||||
@MiraiInternalAPI
|
||||
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
|
||||
actual fun Throwable.addSuppressed(e: Throwable) {
|
||||
if (this === e) {
|
||||
return
|
||||
}
|
||||
if (!isAddSuppressedSupported) {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user