From 9c1e71640eeaf6d0f8853f44d378c9913bbdd248 Mon Sep 17 00:00:00 2001 From: Kalam Azad Date: Tue, 12 Mar 2024 13:59:40 +0800 Subject: [PATCH] Fix --- lib/validation.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/validation.js b/lib/validation.js index 6b73c93..f2860fa 100644 --- a/lib/validation.js +++ b/lib/validation.js @@ -9,6 +9,7 @@ const bodyValidation=(schema,body)=>{ exports.checkKeyMatch=(arr1, arr2,section="Body")=> { // Iterate over each object in arr1 var errors=[] + if(arr1){ for (let obj1 of arr1) { if (obj1.required) { let key = obj1.itemName.toLowerCase() @@ -47,6 +48,7 @@ exports.checkKeyMatch=(arr1, arr2,section="Body")=> { } } + } return errors; // }