Skip to content

Commit

Permalink
Return string.Empty if container id is null or empty
Browse files Browse the repository at this point in the history
  • Loading branch information
joegoldman2 committed Apr 27, 2024
1 parent c7a08b0 commit 0beaa51
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ private static string RemovePrefixAndSuffixIfNeeded(string input, int startIndex
}

var container = pod.Status.ContainerStatuses.SingleOrDefault(p => p.Name == containerName);
if (container is null)
if (container is null || string.IsNullOrEmpty(container.Id))
{
return string.Empty;
}
Expand Down

0 comments on commit 0beaa51

Please sign in to comment.