mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 18:25:24 +00:00
Added check on parameter in isValidRGB funct
This commit is contained in:
4
index.js
4
index.js
@@ -515,6 +515,10 @@ class Pass {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function isValidRGB(value) {
|
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*\)/);
|
let rgb = value.match(/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/);
|
||||||
|
|
||||||
if (!rgb) {
|
if (!rgb) {
|
||||||
|
|||||||
Reference in New Issue
Block a user