From a38e89ba46ebd36e8c70a097586ae73de1d8e953 Mon Sep 17 00:00:00 2001 From: Vyacheslav Moklev Date: Mon, 8 May 2023 21:46:57 +0300 Subject: [PATCH] Fix already bound assert for extensions created from extension listener of a parent --- .../main/kotlin/com/jetbrains/rd/framework/base/RdExtBase.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rd-kt/rd-framework/src/main/kotlin/com/jetbrains/rd/framework/base/RdExtBase.kt b/rd-kt/rd-framework/src/main/kotlin/com/jetbrains/rd/framework/base/RdExtBase.kt index a41e50824..eacfcd1de 100644 --- a/rd-kt/rd-framework/src/main/kotlin/com/jetbrains/rd/framework/base/RdExtBase.kt +++ b/rd-kt/rd-framework/src/main/kotlin/com/jetbrains/rd/framework/base/RdExtBase.kt @@ -74,6 +74,11 @@ abstract class RdExtBase : RdReactiveBase() { //todo make it smarter for ((name, child) in bindableChildren) { + if (child is RdExtBase && child.parent == this) { + // Extensions can be created from extension listener above, in submitExtCreated, + // and they will be already bound at this point, so we should skip them + continue + } if (child is RdPropertyBase<*> && child.defaultValueChanged) { child.localChange { child.bind(lifetime, this, name)