From: Krinkle Date: Mon, 22 Nov 2010 23:40:07 +0000 (+0000) Subject: fixing a TypeError when the function would be called without any arguments X-Git-Tag: 1.31.0-rc.0~33776 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=a8515d25d45f6590943422c44831d6e3fe5fb258;p=lhc%2Fweb%2Fwiklou.git fixing a TypeError when the function would be called without any arguments --- diff --git a/resources/mediawiki.util/mediawiki.util.js b/resources/mediawiki.util/mediawiki.util.js index 9e651cd7e9..15c1735f67 100644 --- a/resources/mediawiki.util/mediawiki.util.js +++ b/resources/mediawiki.util/mediawiki.util.js @@ -258,6 +258,10 @@ */ 'addPortletLink' : function( portlet, href, text, id, tooltip, accesskey, nextnode ) { + // Check if there's atleast 3 arguments to prevent a TypeError + if ( arguments.length < 3 ) { + return null; + } // Setup the anchor tag var $link = $('').attr( 'href', href ).text( text );