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 480aae72d3fe7c10eb51e310b88acc37c34f8bd8
Showing with 1 addition and 1 deletion.
  1. +1 −1 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;
});

0 comments on commit 480aae7

Please sign in to comment.
You can’t perform that action at this time.