r77120 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77119‎ | r77120 | r77121 >
Date:23:40, 22 November 2010
Author:krinkle
Status:ok
Tags:
Comment:
fixing a TypeError when the function would be called without any arguments
Modified paths:
  • /trunk/phase3/resources/mediawiki.util/mediawiki.util.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/mediawiki.util/mediawiki.util.js
@@ -258,6 +258,10 @@
259259 */
260260 'addPortletLink' : function( portlet, href, text, id, tooltip, accesskey, nextnode ) {
261261
 262+ // Check if there's atleast 3 arguments to prevent a TypeError
 263+ if ( arguments.length < 3 ) {
 264+ return null;
 265+ }
262266 // Setup the anchor tag
263267 var $link = $('<a />').attr( 'href', href ).text( text );
264268

Status & tagging log