From dab2b07a884d8a37047957c6e10722753557a9ab Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Mon, 15 Feb 2021 12:28:35 +0100 Subject: [PATCH] Logger: Do not show null elements Extremely hacky, I know. --- lib/utils/logger.dart | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/utils/logger.dart b/lib/utils/logger.dart index 2de005c8..1a6876a2 100644 --- a/lib/utils/logger.dart +++ b/lib/utils/logger.dart @@ -211,8 +211,16 @@ class LogMessage { t = map['t']; l = map['l']; msg = map['msg']; - ex = map['ex']; - stack = map['stack']; - props = map['p']; + ex = _checkForNull(map['ex']); + stack = _checkForNull(map['stack']); + props = _checkForNull(map['p']); } } + +dynamic _checkForNull(dynamic e) { + if (e == null) return e; + if (e.runtimeType == String && e.toString().trim() == 'null') { + return null; + } + return e; +}