Skip to content

Commit

Permalink
use infallible guy
Browse files Browse the repository at this point in the history
  • Loading branch information
adhami3310 committed Jan 16, 2025
1 parent 713f907 commit 1aa728e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions reflex/components/core/cond.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
from reflex.constants import Dirs
from reflex.style import LIGHT_COLOR_MODE, resolved_color_mode
from reflex.utils.imports import ImportDict, ImportVar
from reflex.utils.types import safe_issubclass
from reflex.utils.types import infallible_issubclass
from reflex.vars import VarData
from reflex.vars.base import LiteralVar, ReflexCallable, Var
from reflex.vars.function import ArgsFunctionOperation
@@ -143,7 +143,7 @@ def cond(condition: Any, c1: Any, c2: Any = None) -> Component | Var:

# If the first component is a component, create a Fragment if the second component is not set.
if isinstance(c1, BaseComponent) or (
isinstance(c1, Var) and safe_issubclass(c1._var_type, BaseComponent)
isinstance(c1, Var) and infallible_issubclass(c1._var_type, BaseComponent)
):
c2 = c2 if c2 is not None else Fragment.create()

0 comments on commit 1aa728e

Please sign in to comment.