Skip to content

Conversation

@Arlodotexe
Copy link
Member

@Arlodotexe Arlodotexe commented Aug 26, 2025

Background/Problem

Originally reported by @yoshiask in the Windows App Community #community-infra->Kermit coordination thread:

As an aside, I'm having issues with adding an image to a user:

.\WindowsAppCommunity.CommandLine.exe user images add --user-id k51qzi5uqu5dlcxnaakr3yg32iknb9lz8j0ydyglzldfkgge0otv9gyyy9douu --image-path "C:\Users\jjask\Pictures\Iskhyron.jpeg"
+118ms AddImageCommand InvokeAsync  [Information]  Getting modifiable entity
+314ms AddImageCommand InvokeAsync  [Information]  Got Id: k51qzi5uqu5dlcxnaakr3yg32iknb9lz8j0ydyglzldfkgge0otv9gyyy9douu
+314ms AddImageCommand InvokeAsync  [Information]  Input file:
+314ms AddImageCommand InvokeAsync  [Information]  - Id: C:\Users\jjask\Pictures\Iskhyron.jpeg
+315ms AddImageCommand InvokeAsync  [Information]    Name: Iskhyron.jpeg
+315ms AddImageCommand InvokeAsync  [Information]    GetType: OwlCore.Storage.System.IO.ContentAddressedSystemFile
Unhandled exception: System.InvalidOperationException: Source sequence doesn't contain any elements.
   at System.Linq.AsyncEnumerable.<FirstAsync>g__Core|88_0[TSource](IAsyncEnumerable`1 source, Func`2 predicate, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/First.cs:line 60
   at WindowsAppCommunity.CommandLine.Common.Images.AddImageCommand.InvokeAsync(String repo, String id, String imagePath, String imageId, String imageName) in C:\Users\jjask\source\repos\WindowsAppCommunity\WindowsAppCommunity.CommandLine\src\Commands\Common\Entity\Images\AddImageCommand.cs:line 60

Solution

Fix image retrieval logic in AddImageCommand to handle null imageId correctly.

@Arlodotexe Arlodotexe requested a review from yoshiask August 26, 2025 22:25
@Arlodotexe Arlodotexe enabled auto-merge August 26, 2025 22:25
Copy link
Member

@yoshiask yoshiask left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, tested on my laptop

@Arlodotexe Arlodotexe disabled auto-merge August 27, 2025 02:29
@Arlodotexe Arlodotexe merged commit 7b86af8 into main Aug 27, 2025
1 check passed
@Arlodotexe Arlodotexe deleted the fix/add-image-from-local-path branch August 27, 2025 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants