From 7e58871d3ffa714dbbbedd7d12fc332e2aab37b2 Mon Sep 17 00:00:00 2001 From: Matthew Glissmann Date: Fri, 30 Aug 2024 10:49:20 -0600 Subject: [PATCH] ensure warnings have message before evaluating (#168) --- grommet-leaflet/src/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/grommet-leaflet/src/index.js b/grommet-leaflet/src/index.js index 3422562..647942e 100644 --- a/grommet-leaflet/src/index.js +++ b/grommet-leaflet/src/index.js @@ -15,7 +15,10 @@ const SUPPRESSED_WARNINGS = [ ]; console.error = function filterWarnings(msg, ...args) { - if (msg && !SUPPRESSED_WARNINGS.some(entry => msg.includes(entry))) { + if ( + Array.isArray(msg) && + !SUPPRESSED_WARNINGS.some(entry => msg.includes(entry)) + ) { consoleError(msg, ...args); } };