From 7a058ea258bbad598ed626e51ec88a02acf5c30a Mon Sep 17 00:00:00 2001
From: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
Date: Wed, 5 Feb 2025 15:42:49 -0800
Subject: [PATCH] use safe issubclass

---
 reflex/vars/object.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/reflex/vars/object.py b/reflex/vars/object.py
index 189c8fd78..4cd2241be 100644
--- a/reflex/vars/object.py
+++ b/reflex/vars/object.py
@@ -22,7 +22,12 @@ from typing_extensions import is_typeddict
 
 from reflex.utils import types
 from reflex.utils.exceptions import VarAttributeError
-from reflex.utils.types import GenericType, get_attribute_access_type, get_origin
+from reflex.utils.types import (
+    GenericType,
+    get_attribute_access_type,
+    get_origin,
+    safe_issubclass,
+)
 
 from .base import (
     CachedVarOperation,
@@ -268,7 +273,7 @@ class ObjectVar(Var[OBJECT_TYPE], python_types=Mapping):
 
         if (
             is_typeddict(fixed_type)
-            or (isclass(fixed_type) and not issubclass(fixed_type, Mapping))
+            or (isclass(fixed_type) and not safe_issubclass(fixed_type, Mapping))
             or (fixed_type in types.UnionTypes)
         ):
             attribute_type = get_attribute_access_type(var_type, name)