Pārlūkot izejas kodu

fixed minor error

Markus-Rost 4 gadi atpakaļ
vecāks
revīzija
0f208543ff
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  1. 3 1
      cmds/wiki/gamepedia/search.js

+ 3 - 1
cmds/wiki/gamepedia/search.js

@@ -44,7 +44,9 @@ function gamepedia_search(lang, msg, searchterm, wiki, query, reaction, spoiler)
 			body.query.search.forEach( result => {
 				description.push( '• [' + result.title + '](' + wiki.toLink(result.title, '', '', query.general, true) + ')' + ( result.sectiontitle ? ' § [' + result.sectiontitle + '](' + wiki.toLink(result.title, '', result.sectiontitle, query.general, true) + ')' : '' ) + ( result.redirecttitle ? ' (⤷ [' + result.redirecttitle + '](' + wiki.toLink(result.redirecttitle, '', '', query.general, true) + '))' : '' ) );
 			} );
-			embed.setFooter( lang.get('search.results', body.query.searchinfo.totalhits) );
+			if ( body.query.searchinfo ) {
+				embed.setFooter( lang.get('search.results', body.query.searchinfo.totalhits) );
+			}
 		}
 	}, error => {
 		console.log( '- Error while getting the search results.' + error );