From 18ceb998e076a15c3d54fc42438116861ca8fc2b Mon Sep 17 00:00:00 2001 From: kkapsner Date: Mon, 18 Dec 2017 23:57:25 +0100 Subject: [PATCH] Secured logging color picking --- lib/logging.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/logging.js b/lib/logging.js index 2535273..70509e1 100644 --- a/lib/logging.js +++ b/lib/logging.js @@ -59,10 +59,10 @@ "]"; if (typeof args[0] === "string"){ args[0] = pre + " " + args[0]; - args.splice(1, 0, colors[level]); + args.splice(1, 0, colors[level] || ""); } else { - args.unshift(colors[level]); + args.unshift(colors[level] || ""); args.unshift(pre); } console.log.apply(console, args);