Browse Source

org selection fix

pull/1/head
Kyle Spearrin 9 years ago
parent
commit
b550572175
  1. 6
      src/Console/Program.cs

6
src/Console/Program.cs

@ -178,7 +178,7 @@ namespace Bit.Console @@ -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 @@ -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];
}
}

Loading…
Cancel
Save