diff --git a/redwood-protocol-host/src/commonMain/kotlin/app/cash/redwood/protocol/host/HostProtocolAdapter.kt b/redwood-protocol-host/src/commonMain/kotlin/app/cash/redwood/protocol/host/HostProtocolAdapter.kt index e7a01e1434..50db1fc4b0 100644 --- a/redwood-protocol-host/src/commonMain/kotlin/app/cash/redwood/protocol/host/HostProtocolAdapter.kt +++ b/redwood-protocol-host/src/commonMain/kotlin/app/cash/redwood/protocol/host/HostProtocolAdapter.kt @@ -52,8 +52,8 @@ public class HostProtocolAdapter( factory: ProtocolFactory, private val eventSink: EventSink, ) : ChangesSink { - private val factory = requireNotNull(factory as? GeneratedProtocolFactory) { - "Factory ${factory::class} was not generated by Redwood or is out of date" + private val factory = when (factory) { + is GeneratedProtocolFactory -> factory } private val nodes = mutableMapOf>(