From b083c4fadd1a886e6d116416baaf9ccbf2ad750e Mon Sep 17 00:00:00 2001 From: Rongjian Zhang Date: Mon, 2 Sep 2019 18:14:17 +0800 Subject: [PATCH] fix: handle language color null --- lib/utils/utils.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index e5a12be..8844eda 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -14,6 +14,10 @@ class StorageKeys { } Color convertColor(String cssHex) { + if (cssHex == null) { + return Color(0xffcccccc); // Default color + } + if (cssHex.startsWith('#')) { cssHex = cssHex.substring(1); }