From 3ff55f181ea85783dadd53d6aef29d7ad305c564 Mon Sep 17 00:00:00 2001 From: Yegor Vialov Date: Wed, 29 Apr 2020 10:00:28 +0300 Subject: [PATCH] Fix icon_height parsing issue --- lib/cards/card.class.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cards/card.class.dart b/lib/cards/card.class.dart index e13f0be..29c1b6c 100644 --- a/lib/cards/card.class.dart +++ b/lib/cards/card.class.dart @@ -292,8 +292,8 @@ class ButtonCardData extends CardData { showName = rawData['show_name'] ?? true; showIcon = rawData['show_icon'] ?? true; stateColor = rawData['state_color'] ?? true; - if (rawData.containsKey('icon_height')) { - String rawHeight = rawData['icon_height']; + var rawHeight = rawData['icon_height']; + if (rawHeight != null && rawHeight is String) { if (rawHeight.contains('px')) { iconHeightPx = double.tryParse(rawHeight.replaceFirst('px', '')) ?? 0; } else if (rawHeight.contains('rem')) { @@ -507,4 +507,4 @@ class MediaControlCardData extends CardData { } } -} \ No newline at end of file +}