Skip to content

Commit

Permalink
ensure warnings have message before evaluating (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
halocline authored Aug 30, 2024
1 parent a6ac69f commit 7e58871
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion grommet-leaflet/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};
Expand Down

0 comments on commit 7e58871

Please sign in to comment.