Avoid self-suppression

This commit is contained in:
Him188
2020-03-03 20:04:46 +08:00
parent e022e81cd8
commit b5bd36fb8f
2 changed files with 6 additions and 0 deletions

View File

@@ -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
}

View File

@@ -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
}