From c8aaead5fd0699c1cb17ea38c90581e56eb5002c Mon Sep 17 00:00:00 2001 From: Hugo Rut Date: Wed, 27 Sep 2023 14:33:11 +0200 Subject: [PATCH] fix: nan monthly cost (#201) * fix: nan monthly cost fixes #200 Resolves issue where if monthlyCost was `undefined` we were mistakenly adding it to the cost total. * chore: bump version --- package.json | 2 +- src/block.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b8140cd..2014984 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "infracost", "displayName": "Infracost", "description": "Cloud cost estimates for Terraform in your editor", - "version": "0.2.17", + "version": "0.2.18", "publisher": "Infracost", "license": "Apache-2.0", "icon": "infracost-logo.png", diff --git a/src/block.ts b/src/block.ts index 47d84a9..2175fed 100644 --- a/src/block.ts +++ b/src/block.ts @@ -31,7 +31,7 @@ export default class Block { let cost = 0; for (const r of this.resources) { - if (r.monthlyCost === null) { + if (r.monthlyCost == null) { r.monthlyCost = 0; }