diff options
author | Brandon Aaron <brandon.aaron@gmail.com> | 2007-07-21 01:55:05 +0000 |
---|---|---|
committer | Brandon Aaron <brandon.aaron@gmail.com> | 2007-07-21 01:55:05 +0000 |
commit | 480aae72d3fe7c10eb51e310b88acc37c34f8bd8 (patch) | |
tree | 096a7ba0e5f7ebae2fabee97295e70c006a35674 | |
parent | b965c98ff1cf3038164c627d74df40f68bcc0a82 (diff) | |
download | jquery-480aae72d3fe7c10eb51e310b88acc37c34f8bd8.tar.gz jquery-480aae72d3fe7c10eb51e310b88acc37c34f8bd8.zip |
addClass doesn't fail when passed an undefined or null variable (#1309)
-rw-r--r-- | src/jquery/jquery.js | 2 |
1 files changed, 1 insertions, 1 deletions
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; }); |