From a8515d25d45f6590943422c44831d6e3fe5fb258 Mon Sep 17 00:00:00 2001 From: Krinkle Date: Mon, 22 Nov 2010 23:40:07 +0000 Subject: [PATCH] fixing a TypeError when the function would be called without any arguments --- resources/mediawiki.util/mediawiki.util.js | 4 ++++ 1 file changed, 4 insertions(+) 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 ); -- 2.20.1