From 01c977afa7523f6ec031dd74d3b03a681e6bb793 Mon Sep 17 00:00:00 2001 From: Silas Della Contrada Date: Sat, 10 Aug 2024 16:36:54 +0200 Subject: [PATCH] fix: precondition check for configure --- .../kotlin/dev/silenium/libs/flows/base/JobTransformerBase.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/dev/silenium/libs/flows/base/JobTransformerBase.kt b/src/main/kotlin/dev/silenium/libs/flows/base/JobTransformerBase.kt index 478f700..0524707 100644 --- a/src/main/kotlin/dev/silenium/libs/flows/base/JobTransformerBase.kt +++ b/src/main/kotlin/dev/silenium/libs/flows/base/JobTransformerBase.kt @@ -20,7 +20,7 @@ abstract class JobTransformerBase( protected var job: Job? = null override fun configure(pad: UInt, metadata: IP): Result { - if (!inputMetadata_.containsKey(pad)) return Result.failure(IllegalStateException("pad already configured")) + if (inputMetadata_.containsKey(pad)) return Result.failure(IllegalStateException("pad already configured")) if (pads?.contains(pad) == false) return Result.failure(IllegalStateException("pad not allowed")) inputMetadata_[pad] = metadata