Skip to content

[InputFile] [Docs] Add null check on initialization#3062

Merged
vnbaaij merged 2 commits intomicrosoft:devfrom
MarvinKlein1508:fix-3061
Dec 18, 2024
Merged

[InputFile] [Docs] Add null check on initialization#3062
vnbaaij merged 2 commits intomicrosoft:devfrom
MarvinKlein1508:fix-3061

Conversation

@MarvinKlein1508
Copy link
Copy Markdown
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

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