From 21ee454605a0f5c8e0d0b43205a7e8f165aa5b74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nagy=20L=C3=A1szl=C3=B3?= Date: Tue, 24 Nov 2020 10:45:25 +0100 Subject: [PATCH] Defaulting to short.MaxValue if user entry is blank --- src/licenseGen/Program.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/licenseGen/Program.cs b/src/licenseGen/Program.cs index 000b0fe..2d27077 100644 --- a/src/licenseGen/Program.cs +++ b/src/licenseGen/Program.cs @@ -119,12 +119,19 @@ namespace bitwardenSelfLicensor { WriteLineOver("Extra storage space for the user " + name + ". (max.: " + short.MaxValue + ") [storage]"); buff = Console.ReadLine(); - if (checkStorage(buff)) storage = short.Parse(buff); + if (string.IsNullOrWhiteSpace(buff)) + { + storage = short.MaxValue; + } + else + { + if (checkStorage(buff)) storage = short.Parse(buff); + } } if (licensetype == "user") { - WriteLineOver("Confirm creation of \"user\" license for username: \"" + name + "\", email: \"" + email + "\", User-GUID: \"" + guid + "\"? Y/n"); + WriteLineOver("Confirm creation of \"user\" license for username: \"" + name + "\", email: \"" + email + "\", Storage: \"" + storage + " GB\", User-GUID: \"" + guid + "\"? Y/n"); buff = Console.ReadLine(); if ( buff == "" || buff == "y" || buff == "Y" ) { @@ -138,7 +145,7 @@ namespace bitwardenSelfLicensor } else if (licensetype == "org") { - WriteLineOver("Confirm creation of \"organization\" license for business name: \"" + businessname + "\", username: \"" + name + "\", email: \"" + email + "\", Install-ID: \"" + installid + "\"? Y/n"); + WriteLineOver("Confirm creation of \"organization\" license for business name: \"" + businessname + "\", username: \"" + name + "\", email: \"" + email + "\", Storage: \"" + storage + " GB\", Install-ID: \"" + installid + "\"? Y/n"); buff = Console.ReadLine(); if ( buff == "" || buff == "y" || buff == "Y" ) {