diff --git a/kivymd/uix/segmentedbutton/segmentedbutton.kv b/kivymd/uix/segmentedbutton/segmentedbutton.kv index 23ad70e59..fe04e2839 100644 --- a/kivymd/uix/segmentedbutton/segmentedbutton.kv +++ b/kivymd/uix/segmentedbutton/segmentedbutton.kv @@ -52,13 +52,15 @@ "12dp", \ 0, \ 0 \ - if self.parent.parent.ids.container.parent._label else \ + if hasattr(self, "parent") and hasattr(self.parent, "parent") and \ + self.parent.parent.ids.container.parent._label else \ "12dp", \ 0 icon_color: ( \ self.theme_cls.onSecondaryContainerColor \ - if self.parent.parent.ids.container.parent.active else \ + if hasattr(self, "parent") and hasattr(self.parent, "parent") and \ + self.parent.parent.ids.container.parent.active else \ self.theme_cls.onSurfaceColor \ ) \ if self.theme_icon_color == "Primary" else self.icon_color