From 480aae72d3fe7c10eb51e310b88acc37c34f8bd8 Mon Sep 17 00:00:00 2001 From: Brandon Aaron Date: Sat, 21 Jul 2007 01:55:05 +0000 Subject: [PATCH] addClass doesn't fail when passed an undefined or null variable (#1309) --- src/jquery/jquery.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 741b13b53..d6d3d6a2d 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -1365,7 +1365,7 @@ jQuery.extend({ className: { // internal only, use addClass("class") add: function( elem, c ){ - jQuery.each( c.split(/\s+/), function(i, cur){ + jQuery.each( (c || "").split(/\s+/), function(i, cur){ if ( !jQuery.className.has( elem.className, cur ) ) elem.className += ( elem.className ? " " : "" ) + cur; });