From 8709dd29d6d90eaf5809dcde3873c9eede038d6a Mon Sep 17 00:00:00 2001 From: Benjamin Bolzmann Date: Sat, 30 Jan 2021 21:13:04 +0100 Subject: [PATCH] Updated to .net 5, added NPE Check --- .gitignore | 3 ++- Terraform2AnsibleInventory/T2AI.cs | 2 +- Terraform2AnsibleInventory/Terraform2AnsibleInventory.csproj | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index b623fd0..41e409d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .vs Terraform2AnsibleInventory/bin Terraform2AnsibleInventory/obj -Terraform2AnsibleInventory/Properties \ No newline at end of file +Terraform2AnsibleInventory/Properties +/Terraform2AnsibleInventory/Terraform2AnsibleInventory.csproj.user diff --git a/Terraform2AnsibleInventory/T2AI.cs b/Terraform2AnsibleInventory/T2AI.cs index 9d5363d..a5219ef 100644 --- a/Terraform2AnsibleInventory/T2AI.cs +++ b/Terraform2AnsibleInventory/T2AI.cs @@ -14,7 +14,7 @@ public class T2AI public void PreflightCheck(string[] args) { - if (string.IsNullOrEmpty(args[0])) + if (args.Length == 0 || string.IsNullOrEmpty(args[0])) { PreflightCheck(new string[] { tfstateFile }); return; diff --git a/Terraform2AnsibleInventory/Terraform2AnsibleInventory.csproj b/Terraform2AnsibleInventory/Terraform2AnsibleInventory.csproj index 0eaee1b..d73a5b3 100644 --- a/Terraform2AnsibleInventory/Terraform2AnsibleInventory.csproj +++ b/Terraform2AnsibleInventory/Terraform2AnsibleInventory.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net5.0