Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Application crashes when ToolbarItem is created with invalid IconImageSource name #27095

Open
nivetha-nagalingam opened this issue Jan 13, 2025 · 1 comment
Labels
t/bug Something isn't working

Comments

@nivetha-nagalingam
Copy link
Contributor

Description

When creating a ToolbarItem with an IconImageSource property set to a name that doesn't correspond to any existing image resource in the project, the iOS application crashes with an unhandled ArgumentException. This occurs during the initialization of the ToolbarItem, preventing the application from launching successfully.
Note: While fixing this issue enable the test case from HostApp: Issue2222.

Image

Steps to Reproduce

  1. Issue2222.cs.zip
  2. Run the Application on an iOS
  3. Observe the Exception.

Expected Behavior:
The application should display the ToolbarItem without an icon, allowing the app to continue running without crashing, while potentially logging the image loading failure for debugging purposes.

Actual Behavior:
The application immediately crashes during startup with an unhandled System.ArgumentException stating "Unable to load image stream", preventing any user interaction with the app.

Link to public reproduction project repository

No response

Version with bug

9.0.22 SR2.2

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iphone 18.0

Did you find any workaround?

No response

Relevant log output

@nivetha-nagalingam nivetha-nagalingam added the t/bug Something isn't working label Jan 13, 2025
@Ying-6
Copy link

Ying-6 commented Jan 14, 2025

Hi @nivetha-nagalingam, this issue has been verified in Visual Studio 17.13.0 Preview 2.1(9.0.22) using the .cs file you provided, but I can't reproduce your issue. Could you help check whether the project I changed is consistent with yours? Do I need to change other code? Or could you provide your complete project so we can investigate it further? Looking forward to your reply!
MauiApp34.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants