From: John Resig Date: Fri, 20 Jul 2007 19:44:15 +0000 (+0000) Subject: Added a fix for when trim receives a null value (bug #1395). X-Git-Url: http://git.asbjorn.biz/?a=commitdiff_plain;h=a2482e5e87558edb2be67fd6e7369bb62168fde9;p=jquery.git Added a fix for when trim receives a null value (bug #1395). --- diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 8e370f8..2f3bc02 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -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 ) {