From d0acb621cf8ed2a6a4f977a4dc56b6e5f87d02cf Mon Sep 17 00:00:00 2001 From: Ekaterina Koltsova Date: Mon, 22 Jan 2018 19:58:57 +0300 Subject: [PATCH] Added empty wdl string check --- src/parser/parse.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/parser/parse.js b/src/parser/parse.js index fd09a07..9213973 100644 --- a/src/parser/parse.js +++ b/src/parser/parse.js @@ -25,12 +25,14 @@ import parseWDL from './WDL/parse'; * @returns {Promise} Parsing result object */ function parse(text, opts = {}) { + if (!text) { + return Promise.reject('No data to parse'); + } const format = opts.format || 'wdl'; const subWfDetailing = (opts.subWfDetailing && _.isArray(opts.subWfDetailing)) ? opts.subWfDetailing : null; const recursionDepth = opts.recursionDepth || 0; const baseURI = opts.baseURI || null; const zipFile = opts.zipFile || null; - if (format === 'wdl') { if (zipFile) { return JSZip.loadAsync(zipFile).then((files) => {