Skip to content

Conversation

@MarvinKlein1508
Copy link
Collaborator

Pull Request

📖 Description

This PR adds a null check to FluentInputFile.razor.js to prevent a crash which happens when the user leaves the page before the FluentInputFile has been fully initialized. Without this null check the app might eventually crash.

In addition this PR also adds a try/catch for the CodeSnippet component for the demo sites. Which has the same problem on fast navigations. Here a null check is not possible because hljs is not null and the javascript which is being executed is a third party library.

🎫 Issues

Fixes #3061

📑 Test Plan

✅ Checklist

General

  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

Component-specific

  • I have added a new component
  • I have added Unit Tests for my new component
  • I have modified an existing component (FluentInputFile & CodeSnippet)
  • I have validated the Unit Tests for an existing component

@vnbaaij vnbaaij enabled auto-merge (squash) December 18, 2024 14:28
@vnbaaij vnbaaij merged commit a83077b into microsoft:dev Dec 18, 2024
4 checks passed
@MarvinKlein1508 MarvinKlein1508 deleted the fix-3061 branch December 18, 2024 14:53
@vnbaaij vnbaaij added this to the v4.11 milestone Dec 19, 2024
@vnbaaij vnbaaij changed the title [FluentInputFile] [Docs] Add null check on initialization [InputFile] [Docs] Add null check on initialization Dec 19, 2024
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.

fix: FluentInputFile results in crash on fast navigation

2 participants