aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2018-01-04 05:47:16 +0100
committerache <ache@ache.one>2018-01-04 05:47:16 +0100
commitd2941b43d4ffbb5ffd1ec08ffaa8c13a93bfabd8 (patch)
tree9e6db6688e66f10a0eaff6a115e4acae791e36a3
parentFix name (diff)
Fix catch qcm
-rw-r--r--app.js11
1 files 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 ) => {