Print "unknown peer" instead of null, if no RPC peer is known

This commit is contained in:
Andrew Ferrazzutti 2022-05-10 01:16:03 -04:00
parent 652aa22048
commit 3f8660a3c4
1 changed files with 3 additions and 3 deletions

View File

@ -422,7 +422,7 @@ export default class PeerClient {
this.stopped = false
this.notificationID = 0
this.maxCommandID = 0
this.peerID = null
this.peerID = ""
this.deviceName = "KakaoTalk Bridge"
/** @type {[string]} */
this.loggingKeys = []
@ -483,11 +483,11 @@ export default class PeerClient {
if (this.peerID && this.manager.clients.get(this.peerID) === this) {
this.manager.clients.delete(this.peerID)
}
this.log(`Connection closed (peer: ${this.peerID})`)
this.log(`Connection closed (peer: ${this.peerID || "unknown peer"})`)
}
#closeUsers() {
this.log("Closing all API clients for", this.peerID)
this.log(`Closing all API clients for ${this.peerID || "unknown peer"}`)
for (const userClient of this.userClients.values()) {
userClient.disconnect()
}