mirror of
https://github.com/jquery/jquery.git
synced 2026-02-06 22:15:05 -05:00
Made sure that .removeClass(null) doesn't throw an exception. Fixes #3847.
This commit is contained in:
@@ -708,7 +708,7 @@ jQuery.extend({
|
||||
|
||||
// internal only, use hasClass("class")
|
||||
has: function( elem, className ) {
|
||||
return jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1;
|
||||
return elem && jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user