From f69412fd955246e6b623dfcdba854f4af5a4c343 Mon Sep 17 00:00:00 2001
From: "Herfort, Thomas" <Thomas.Herfort@br.de>
Date: Wed, 16 Jan 2019 10:04:21 +0000
Subject: [PATCH] index.js aktualisiert

---
 index.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/index.js b/index.js
index e0aad2e..b1726bb 100644
--- a/index.js
+++ b/index.js
@@ -71,17 +71,17 @@ function Log (options) {
   }
   this.log = function (tag, message, tags) {
     let tadd = ''
-    if (typeof tags !== 'undefined' && typeof tags === 'string') {
+    if (typeof tags !== 'undefined') {
       if (Array.isArray(tags)) {
         tadd = ' #' + tags.join(' #')
-      } else if (tags.includes(' ')) {
+      } else if (typeof tags === 'string' && tags.includes(' ')) {
         tadd = ' #' + tags.split(' ').join(' #')
-      } else if (tags.includes(',')) {
+      } else if (typeof tags === 'string' && tags.includes(',')) {
         tadd = ' #' + tags.split(',').join(' #')
       } else {
         tadd = ' #' + tags
       }
-    } else { tadd = tags}
+    }
     
     let msg = this.getDate() + '\t' + this.hostname + '\t' + this.name + '\t' + tag + '\t' + message + tadd
     switch (tag) {
-- 
GitLab