From a5cbe497a2cb5669c6da38296e3f4ae133ff9ffe Mon Sep 17 00:00:00 2001 From: alexandercerutti Date: Tue, 21 Aug 2018 18:09:02 +0200 Subject: [PATCH] Added check on parameter in isValidRGB funct --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index dd183e5..3f1e5b2 100644 --- a/index.js +++ b/index.js @@ -515,6 +515,10 @@ class Pass { */ function isValidRGB(value) { + if (!value || typeof value !== "string") { + return false; + } + let rgb = value.match(/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/); if (!rgb) {