mirror of
https://github.com/corda/corda.git
synced 2025-01-29 15:43:55 +00:00
Create an emptyMap when MDC.getCopyOfContextMap() is null (#5545)
This commit is contained in:
parent
2965a21d2f
commit
e0eb358d59
@ -83,7 +83,7 @@ class AMQPBridgeManager(config: MutualSslConfiguration,
|
||||
}
|
||||
|
||||
private fun withMDC(block: () -> Unit) {
|
||||
val oldMDC = MDC.getCopyOfContextMap()
|
||||
val oldMDC = MDC.getCopyOfContextMap() ?: emptyMap<String, String>()
|
||||
try {
|
||||
MDC.put("queueName", queueName)
|
||||
MDC.put("targets", targets.joinToString(separator = ";") { it.toString() })
|
||||
|
@ -46,7 +46,7 @@ internal class ConnectionStateMachine(private val serverMode: Boolean,
|
||||
}
|
||||
|
||||
private fun withMDC(block: () -> Unit) {
|
||||
val oldMDC = MDC.getCopyOfContextMap()
|
||||
val oldMDC = MDC.getCopyOfContextMap() ?: emptyMap<String, String>()
|
||||
try {
|
||||
MDC.put("serverMode", serverMode.toString())
|
||||
MDC.put("localLegalName", localLegalName)
|
||||
|
@ -41,7 +41,7 @@ internal class EventProcessor(channel: Channel,
|
||||
}
|
||||
|
||||
private fun withMDC(block: () -> Unit) {
|
||||
val oldMDC = MDC.getCopyOfContextMap()
|
||||
val oldMDC = MDC.getCopyOfContextMap() ?: emptyMap<String, String>()
|
||||
try {
|
||||
MDC.put("serverMode", serverMode.toString())
|
||||
MDC.put("localLegalName", localLegalName)
|
||||
|
@ -49,7 +49,7 @@ internal class AMQPChannelHandler(private val serverMode: Boolean,
|
||||
private var badCert: Boolean = false
|
||||
|
||||
private fun withMDC(block: () -> Unit) {
|
||||
val oldMDC = MDC.getCopyOfContextMap()
|
||||
val oldMDC = MDC.getCopyOfContextMap() ?: emptyMap<String, String>()
|
||||
try {
|
||||
MDC.put("serverMode", serverMode.toString())
|
||||
MDC.put("remoteAddress", remoteAddress.toString())
|
||||
|
Loading…
x
Reference in New Issue
Block a user