浏览代码

fix error

Markus-Rost 4 年之前
父节点
当前提交
5c7424147a
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      functions/parse_page.js

+ 2 - 2
functions/parse_page.js

@@ -94,8 +94,8 @@ const removeClassesExceptions = [
  */
 function parse_page(lang, msg, content, embed, wiki, reaction, {title, contentmodel, missing, pageprops: {infoboxes, disambiguation} = {}, uselang = lang.lang, noRedirect = false}, thumbnail = '', fragment = '', pagelink = '') {
 	if ( reaction ) reaction.removeEmoji();
-	if ( !msg?.showEmbed?.() || missing !== undefined || embed.description ) {
-		if ( missing !== undefined ) {
+	if ( !msg?.showEmbed?.() || missing !== undefined || !embed || embed.description ) {
+		if ( missing !== undefined && embed ) {
 			if ( embed.backupField && embed.length < 4750 && embed.fields.length < 25 ) {
 				embed.spliceFields( 0, 0, embed.backupField );
 			}