From 05d6986349e0fae75a2fc993b00ac2454a831357 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Thu, 5 Nov 2020 12:57:13 +0100 Subject: [PATCH] Handle erroneous input better --- src/claimVerification.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/claimVerification.js b/src/claimVerification.js index 7290f7d..f6e0cff 100644 --- a/src/claimVerification.js +++ b/src/claimVerification.js @@ -32,7 +32,9 @@ const runOnJson = (res, proofData, checkPath, checkClaim, checkRelation) => { return res } - if (!(checkPath[0] in proofData)) { + try { + checkPath[0] in proofData + } catch(e) { res.errors.push('err_data_structure_incorrect') return res }