Skip to content

[BUG] App crashes when displaying model documentation with formatted links #548

@weiyuanyue

Description

@weiyuanyue

The application crashes with an ArgumentException when rendering markdown documentation that contains hyperlinks with embedded UI elements.

Image

Steps to Reproduce

  1. Launch AI Dev Gallery application
  2. Navigate to Models page
  3. Select Generative category
  4. Click on Stable Diffusion model

Result: Application crashes immediately when the documentation loads.

Expected Behavior

  • Model documentation should render correctly with all hyperlinks functional
  • Application should remain stable and responsive
  • Users should be able to click on links to access external documentation
  • No crashes or unexpected termination

Actual Behavior

Application crashes with the following error:

Microsoft.UI.Xaml.dll!00007FFF0E21BFA4: 80070057 - E_INVALIDARG
Exception thrown: 'System.ArgumentException' in System.Private.CoreLib.dll
Value does not fall within the expected range.

Stack trace:
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
   at WinRT.DelegateExtensions.DynamicInvokeAbi(Delegate del, Object[] invoke_params)
   at ABI.System.Collections.Generic.IListMethods`2.AppendDynamic(IObjectReference obj, T value)
   at Microsoft.UI.Xaml.Documents.InlineCollection.Add(Inline item)
   at CommunityToolkit.Labs.WinUI.MarkdownTextBlock.TextElements.MyHyperlink.AddChild(IAddChild child)
  • App Version: 0.5.4

Additional Context

The crash occurs specifically when the markdown rendering engine attempts to add certain types of inline elements to hyperlink objects. The error code 0x80070057 (E_INVALIDARG) suggests an invalid argument is being passed to a WinUI component.

Debug output shows the crash happens when processing InlineUIContainer elements:

[MyHyperlink.AddChild] Attempting to add inline:
  - Inline type: InlineUIContainer
  - Current hyperlink Inlines count: 0

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions