Skip to content

Commit

Permalink
Bugfix: detach variables from Realm before using in VariableManager
Browse files Browse the repository at this point in the history
  • Loading branch information
Waboodoo committed May 22, 2024
1 parent c04b80b commit 617a1a9
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ import java.io.UnsupportedEncodingException
import java.net.URLEncoder

class VariableManager(
val variables: List<Variable>,
variables: List<Variable>,
preResolvedValues: Map<VariableKey, String> = emptyMap(),
) : VariableLookup {

val variables: List<Variable>

private val variablesById: Map<VariableId, Variable>

private val variablesByKey: Map<VariableKey, Variable>
Expand All @@ -26,6 +28,7 @@ class VariableManager(

init {
val detachedVariables = variables.map { if (it.isManaged()) it.copyFromRealm() else it }
this.variables = variables
variablesById = detachedVariables.associateBy { it.id }
variablesByKey = detachedVariables.associateBy { it.key }

Expand Down

0 comments on commit 617a1a9

Please sign in to comment.