MediaWiki talk:Gadget-CategoryAboveAll.js

Latest comment: 10 years ago by Lokal Profil in topic Null check for bodyContent


Edit request

edit

Please see MediaWiki talk:Gadget-CategoryAboveBelowImage.js. -- User:Docu at 13:02, 27 February 2010 (UTC)Reply

done. Esby (talk) 20:18, 28 February 2010 (UTC)Reply

Null check for bodyContent

edit

{{Editprotected}} Please add a null check for bc. Otherwise, it will throw in skins without bodyContent, including CologneBlue and Modern. Replace:

  bc.insertBefore(cats, bc.childNodes[0]);

with:

if ( bc !== null ) {
  bc.insertBefore(cats, bc.childNodes[0]);
}

mw.util.$content could potentially be used if it's null, or jQuery, etc. but the above will at least stop it from throwing an exception. Superm401 - Talk 19:06, 4 March 2014 (UTC)Reply

  Done /Lokal_Profil 13:12, 5 March 2014 (UTC)Reply
Return to "Gadget-CategoryAboveAll.js" page.