From 2093e89f823dab98bbc300698dea6e4f73c36a86 Mon Sep 17 00:00:00 2001 From: Vijay Soni Date: Thu, 1 Aug 2024 23:41:05 +0530 Subject: [PATCH] Fix TypeError for undefined response properties in InfluxDBReporter Related to #41 Add a check to handle undefined response properties in `InfluxDBReporter.request` function. * Add a check to ensure `args.response` is defined before accessing its properties. * Log an error message and skip the current request if `args.response` is undefined. --- src/influxdb-reporter.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/influxdb-reporter.js b/src/influxdb-reporter.js index 55bf2fb..57557f3 100644 --- a/src/influxdb-reporter.js +++ b/src/influxdb-reporter.js @@ -87,6 +87,11 @@ class InfluxDBReporter { console.log(`[${this.context.currentItem.index}] Running ${item.name}`); + if (!args.response) { + console.log(`[-] ERROR: Response is undefined for request ${item.name}`); + return; + } + const data = { collection_name: this.options.collection.name, id: this.context.identifier,