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

Fixed ObjectDisposedException in Blazor Web App (InteractiveWebAssembly to StreamRendering mode) #595

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

theumairtahir
Copy link

Added a try-catch block around the InvokeVoidAsync method call to
handle potential ObjectDisposedException exceptions. This ensures
graceful handling of scenarios where the JavaScript runtime might
not be available, such as in a hybrid Blazor Web App environment.
The catch block includes a comment explaining that no action is
needed if this exception occurs.

Fix of issue #594

Umair Tahir added 2 commits January 27, 2025 10:49
…ly to StreamRendering mode)

Added a try-catch block around the InvokeVoidAsync method call to
handle potential ObjectDisposedException exceptions. This ensures
graceful handling of scenarios where the JavaScript runtime might
not be available, such as in a hybrid Blazor Web App environment.
The catch block includes a comment explaining that no action is
needed if this exception occurs.
Moved the try-catch block inside the if statement checking for
non-null _styleFunctions. This ensures the try block is only
executed when _styleFunctions is available and handles
ObjectDisposedException in the same context, improving code
structure and readability.
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.

1 participant