diff --git a/src/Commands/Common/Entity/Images/AddImageCommand.cs b/src/Commands/Common/Entity/Images/AddImageCommand.cs index 52466d0..abbd126 100644 --- a/src/Commands/Common/Entity/Images/AddImageCommand.cs +++ b/src/Commands/Common/Entity/Images/AddImageCommand.cs @@ -57,7 +57,7 @@ public async Task InvokeAsync(string repo, string id, string imagePath, string? Logger.LogInformation($" {nameof(imageFile.GetType)}: {imageFile.GetType()}"); await entity.AddImageAsync(imageFile, imageId ?? imageFile.Id, imageName, cancellationToken); - var addedImage = await entity.GetImageFilesAsync(cancellationToken).FirstAsync(x=> x.Id == imageId || x.Name == imageName, cancellationToken: cancellationToken); + var addedImage = await entity.GetImageFilesAsync(cancellationToken).FirstAsync(x=> x.Id == (imageId ?? imageFile.Id) || x.Name == imageName, cancellationToken: cancellationToken); Logger.LogInformation($"Added file:"); Logger.LogInformation($"- {nameof(addedImage.Id)}: {addedImage.Id}"); Logger.LogInformation($" {nameof(addedImage.Name)}: {addedImage.Name}");