X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Fsrc%2Fjquery%2Fjquery.colorUtil.js;h=d46d0099093db854a9cde7d49f6e63968f9e01b6;hb=e69bcfad17d67da5113cdd75276a5f7b5cefb123;hp=a5b136d9691834413309beafd0067b9848552cd6;hpb=313dde5d06c42be1eb7da9127ec92bb5d360ddab;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/jquery/jquery.colorUtil.js b/resources/src/jquery/jquery.colorUtil.js index a5b136d969..d46d009909 100644 --- a/resources/src/jquery/jquery.colorUtil.js +++ b/resources/src/jquery/jquery.colorUtil.js @@ -29,6 +29,9 @@ if ( color && Array.isArray( color ) && color.length === 3 ) { return color; } + if ( typeof color !== 'string' ) { + return undefined; + } // Look for rgb(num,num,num) // eslint-disable-next-line no-cond-assign @@ -77,7 +80,7 @@ } // Otherwise, we're most likely dealing with a named color - return $.colorUtil.colors[ $.trim( color ).toLowerCase() ]; + return $.colorUtil.colors[ color.trim().toLowerCase() ]; }, /**