add a defensive guard before giving up

This commit is contained in:
Khaleel Al-Adhami 2025-02-04 17:06:54 -08:00
parent 4ed9b8ff7c
commit cac082503b

View File

@ -56,7 +56,7 @@ class Foreach(Component):
"""
from reflex.vars import ArrayVar, ObjectVar, StringVar
iterable = LiteralVar.create(iterable)
iterable = LiteralVar.create(iterable).guess_type()
if iterable._var_type == Any:
raise ForeachVarError(