Skip to content

Commit e9662f4

Browse files
authored
Skip non-BaseState classes for dep tracking (#6052)
1 parent 1b6b2c2 commit e9662f4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

reflex/vars/dep_tracking.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,11 @@ def load_attr_or_method(self, instruction: dis.Instruction) -> None:
179179
if not self.top_of_stack:
180180
return
181181
target_obj = self.get_tracked_local(self.top_of_stack)
182-
target_state = assert_base_state(target_obj, local_name=self.top_of_stack)
182+
try:
183+
target_state = assert_base_state(target_obj, local_name=self.top_of_stack)
184+
except VarValueError:
185+
# If the target state is not a BaseState, we cannot track dependencies on it.
186+
return
183187
try:
184188
ref_obj = getattr(target_state, instruction.argval)
185189
except AttributeError:

0 commit comments

Comments
 (0)