Skip to content
Permalink
Browse files
addClass doesn't fail when passed an undefined or null variable (#1309)
  • Loading branch information
brandonaaron committed Jul 21, 2007
1 parent b965c98 commit 480aae7
Showing 1 changed file with 1 addition and 1 deletion.
@@ -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;
});

0 comments on commit 480aae7

Please sign in to comment.