1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-10 13:23:18 +00:00

org selection fix

This commit is contained in:
Kyle Spearrin
2017-05-13 17:09:08 -04:00
parent 327682529b
commit b550572175

View File

@@ -178,7 +178,7 @@ namespace Bit.Console
if(result.Success && result.Organizations.Count > 1)
{
Organization org = null;
if(string.IsNullOrWhiteSpace(orgId))
if(!string.IsNullOrWhiteSpace(orgId))
{
org = result.Organizations.FirstOrDefault(o => o.Id == orgId);
}
@@ -193,9 +193,9 @@ namespace Bit.Console
Con.Write("Select your organization: ");
var orgIndexInput = Con.ReadLine().Trim();
int orgIndex;
if(int.TryParse(orgIndexInput, out orgIndex))
if(int.TryParse(orgIndexInput, out orgIndex) && result.Organizations.Count >= orgIndex)
{
org = result.Organizations[orgIndex];
org = result.Organizations[orgIndex - 1];
}
}