diff --git a/lib/entities/entity.class.dart b/lib/entities/entity.class.dart index c388b73..7652f66 100644 --- a/lib/entities/entity.class.dart +++ b/lib/entities/entity.class.dart @@ -79,7 +79,8 @@ class Entity { ); String get displayName => - attributes["friendly_name"] ?? (attributes["name"] ?? entityId.split(".")[1].replaceAll("_", " ")); + attributes["friendly_name"] ?? + (attributes["name"] ?? (entityId != null && entityId.contains('.')) ? entityId.split(".")[1].replaceAll("_", " ") : ""); bool get isView => (domain == "group") &&