diff --git a/Sources/WebMIDIKit/MIDIPortMap.swift b/Sources/WebMIDIKit/MIDIPortMap.swift index 3bdb1c5..88e9688 100644 --- a/Sources/WebMIDIKit/MIDIPortMap.swift +++ b/Sources/WebMIDIKit/MIDIPortMap.swift @@ -57,7 +57,7 @@ public class MIDIPortMap: Collection { if port.isVirtual { return self[port.id]! } else { - assert(self[port.id] == nil) + assert(self[port.id] == nil, "Port with ID \(port.id) should not exist, yet") self[port.id] = port return port } @@ -66,8 +66,7 @@ public class MIDIPortMap: Collection { internal final func remove(_ endpoint: MIDIEndpoint) -> Value? { // disconnect? - guard let port = self[endpoint] else { assert(false); return nil } - assert(port.state == .connected) + guard let port = self[endpoint] else { return nil } self[port.id] = nil return port }