mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-13 14:53:16 +00:00
org selection fix
This commit is contained in:
@@ -178,7 +178,7 @@ namespace Bit.Console
|
|||||||
if(result.Success && result.Organizations.Count > 1)
|
if(result.Success && result.Organizations.Count > 1)
|
||||||
{
|
{
|
||||||
Organization org = null;
|
Organization org = null;
|
||||||
if(string.IsNullOrWhiteSpace(orgId))
|
if(!string.IsNullOrWhiteSpace(orgId))
|
||||||
{
|
{
|
||||||
org = result.Organizations.FirstOrDefault(o => o.Id == orgId);
|
org = result.Organizations.FirstOrDefault(o => o.Id == orgId);
|
||||||
}
|
}
|
||||||
@@ -193,9 +193,9 @@ namespace Bit.Console
|
|||||||
Con.Write("Select your organization: ");
|
Con.Write("Select your organization: ");
|
||||||
var orgIndexInput = Con.ReadLine().Trim();
|
var orgIndexInput = Con.ReadLine().Trim();
|
||||||
int orgIndex;
|
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];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user