Skip to content

Commit

Permalink
Fix TypeError for undefined response properties in InfluxDBReporter
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vs4vijay committed Aug 1, 2024
1 parent 58a9208 commit 2093e89
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/influxdb-reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2093e89

Please sign in to comment.