From 5c5e3d18fc328ff0f53247623f594759a2db19d8 Mon Sep 17 00:00:00 2001 From: Pragadesh-45 <54320162+Pragadesh-45@users.noreply.github.com> Date: Fri, 4 Oct 2024 16:53:35 +0530 Subject: [PATCH] add logic to check for key existence in post response (#3249) --- packages/bruno-js/src/runtime/vars-runtime.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/bruno-js/src/runtime/vars-runtime.js b/packages/bruno-js/src/runtime/vars-runtime.js index 1ed806000..94e45f46e 100644 --- a/packages/bruno-js/src/runtime/vars-runtime.js +++ b/packages/bruno-js/src/runtime/vars-runtime.js @@ -50,7 +50,9 @@ class VarsRuntime { _.each(enabledVars, (v) => { try { const value = evaluateJsExpressionBasedOnRuntime(v.value, context, this.runtime); - bru.setVar(v.name, value); + if (v.name) { + bru.setVar(v.name, value); + } } catch (error) { errors.set(v.name, error); }