From d2941b43d4ffbb5ffd1ec08ffaa8c13a93bfabd8 Mon Sep 17 00:00:00 2001 From: ache Date: Thu, 4 Jan 2018 05:47:16 +0100 Subject: Fix catch qcm --- app.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index de2f072..de1f2d7 100644 --- a/app.js +++ b/app.js @@ -31,11 +31,14 @@ function visitList(ast, vFile) { var tab = [] Array.from(node.children).forEach( ( nodeC ) => { - if( nodeC.children[0].type == 'paragraph' ) { - if( "~!=".indexOf(nodeC.children[0].children[0].value[0]) < 0) { + if( nodeC.children && nodeC.children[0].type == 'paragraph' ) { + if( nodeC.children[0].children && nodeC.children[0].children[0].value ) { + if( "~!=".indexOf(nodeC.children[0].children[0].value[0]) < 0) + isQcm = false; + } else isQcm = false; - } - } + } else + isQcm = false; }); if( isQcm ) { Array.from(node.children).forEach( ( nodeC ) => { -- cgit v1.2.3