Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
| } | ||
|
|
||
| public async Task ExecuteAsync(EpmAgentOptions options) | ||
| { |
There was a problem hiding this comment.
add the null validation for options
if (options == null)
Commander/EPM/EpmAgentCommand.cs
Outdated
| if (string.IsNullOrEmpty(options.Command)) | ||
| { | ||
| options.Command = "list"; | ||
| } |
There was a problem hiding this comment.
use ?: for better validation
var command = string.IsNullOrEmpty(options.Command)
? "list"
: options.Command.Trim().ToLowerInvariant();
Commander/EPM/EpmAgentCommand.cs
Outdated
| return; | ||
| } | ||
|
|
||
| var agentUid = agentUids[0]; |
There was a problem hiding this comment.
var agentUid = agentUids[0]?.Trim();
if (string.IsNullOrEmpty(agentUid))
{
Console.WriteLine("Agent UID is required for 'view' command.");
return;
}
|
|
||
| bool? disabled = null; | ||
| if (!string.IsNullOrEmpty(options.Enable)) | ||
| { |
There was a problem hiding this comment.
var enableValue = options.Enable?.Trim();
if (!string.IsNullOrEmpty(enableValue))
{
var enableLower = enableValue.ToLowerInvariant();
| { | ||
| return; | ||
| } | ||
|
|
There was a problem hiding this comment.
Below code block should be in try - catch?
Commander/EPM/EpmAgentCommand.cs
Outdated
|
|
||
| private async Task RemoveAgentAsync(string agentUid) | ||
| { | ||
| if (string.IsNullOrEmpty(agentUid)) |
There was a problem hiding this comment.
var uid = agentUid?.Trim();
if (string.IsNullOrEmpty(uid))
{
| } | ||
|
|
||
| private void ListAgentCollections(EpmAgentOptions options) | ||
| { |
There was a problem hiding this comment.
add validation
if (options == null)
{
return;
}
Commander/EPM/EpmAgentCommand.cs
Outdated
| var parts = data.Select(kvp => $"{kvp.Key}={kvp.Value}").ToList(); | ||
| value = string.Join(", ", parts); | ||
| } | ||
| catch |
| } | ||
|
|
||
| public async Task ExecuteAsync(EpmApprovalOptions options) | ||
| { |
There was a problem hiding this comment.
same review points if (options == null)
Commander/EPM/EpmApprovalCommand.cs
Outdated
| if (string.IsNullOrEmpty(options.Command)) | ||
| { | ||
| options.Command = "list"; | ||
| } |
There was a problem hiding this comment.
var command = string.IsNullOrEmpty(options.Command)
? "list"
: options.Command.Trim().ToLowerInvariant();
Co-authored-by: amandli-ks <amandli@keepersecurity.com>
35bcb8e to
0aac0d0
Compare
No description provided.