Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions OnePassword.NET/OnePasswordManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,10 @@ private string Op(string command, IEnumerable<string> input, bool returnError)
case Mode.Interactive:
case Mode.AppIntegrated:
default:
var passAccount = !(_mode == Mode.AppIntegrated || IsExcludedCommand(command, _excludedAccountCommands));
if (passAccount && _account.Length == 0)
var excluded = IsExcludedCommand(command, _excludedAccountCommands);
var requireAccount = _mode != Mode.AppIntegrated && !excluded;
var passAccount = _account.Length != 0 && !excluded;
if (requireAccount && !passAccount)
throw new InvalidOperationException("Cannot execute command because account has not been set.");

var passSession = !(_mode == Mode.AppIntegrated || IsExcludedCommand(command, _excludedSessionCommands));
Expand Down