Added a fix for when trim receives a null value (bug #1395).

This commit is contained in:
John Resig 2007-07-20 19:44:15 +00:00
parent 42f30dd181
commit a2482e5e87

View file

@ -1607,7 +1607,7 @@ jQuery.extend({
* @cat JavaScript
*/
trim: function(t){
return t.replace(/^\s+|\s+$/g, "");
return (t||"").replace(/^\s+|\s+$/g, "");
},
makeArray: function( a ) {