Merge "user: Allow "CAS update failed" exceptions to be normalised"
[lhc/web/wiklou.git] / resources / src / jquery / jquery.colorUtil.js
index a5b136d..009be1a 100644 (file)
@@ -6,7 +6,7 @@
  * Mostly based on other plugins and functions (linted and optimized a little).
  * Sources cited inline.
  */
-( function ( $ ) {
+( function () {
        /**
         * @class jQuery.colorUtil
         * @singleton
@@ -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() ];
                },
 
                /**
 
        };
 
-}( jQuery ) );
+}() );