http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88813

Revision: 88813
Author:   kaldari
Date:     2011-05-25 18:42:49 +0000 (Wed, 25 May 2011)
Log Message:
-----------
protect against option being undefined in the config

Modified Paths:
--------------
    trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js

Modified: trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js
===================================================================
--- trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js 
2011-05-25 18:41:31 UTC (rev 88812)
+++ trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js 
2011-05-25 18:42:49 UTC (rev 88813)
@@ -146,9 +146,11 @@
                                for( var subtypeId in 
$.wikiLove.options.types[$.wikiLove.currentTypeId].subtypes ) {
                                        // add all the subtypes to the menu 
while setting their subtype ids in jQuery data
                                        var subtype = 
$.wikiLove.options.types[$.wikiLove.currentTypeId].subtypes[subtypeId];
-                                       $( '#mw-wikilove-subtype' ).append(
-                                               $( '<option></option>' ).text( 
subtype.option ).data( 'subtypeId', subtypeId )
-                                       );
+                                       if ( typeof subtype.option != 
'undefined' ) {
+                                               $( '#mw-wikilove-subtype' 
).append(
+                                                       $( '<option></option>' 
).text( subtype.option ).data( 'subtypeId', subtypeId )
+                                               );
+                                       }
                                }
                                $( '#mw-wikilove-subtype' ).show();
                                


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to