Skip to content

Prevent null refs in RemoteJSRuntime #14603

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

Merged
merged 1 commit into from
Oct 1, 2019

Conversation

pranavkm
Copy link
Contributor

@pranavkm pranavkm commented Oct 1, 2019

Fixes #13396

@@ -70,12 +70,12 @@ private void EndInvokeDotNetCore(string callId, bool success, object resultOrErr

protected override void BeginInvokeJS(long asyncHandle, string identifier, string argsJson)
{
if (!_clientProxy.Connected)
if (_clientProxy is null)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_clientProxy isn't initiailized during pre-rendering and this change reflects that. Knowing how unreliable the the Connected flag is, it made sense to avoid checking it here. It makes the experience with JSInterop a bit more consistent - users should now consistently see timeouts from JSInterop calls when the client send failed, rather than a timeout sometime and a sync exception at other times.

@Eilon Eilon added the area-blazor Includes: Blazor, Razor Components label Oct 1, 2019
@pranavkm pranavkm changed the base branch from release/3.1 to release/3.1-preview1 October 1, 2019 20:51
@mkArtakMSFT mkArtakMSFT merged commit cc368c8 into release/3.1-preview1 Oct 1, 2019
@mkArtakMSFT mkArtakMSFT deleted the prkrishn/null-ref branch October 1, 2019 23:08
@egil
Copy link
Contributor

egil commented Oct 15, 2019

@pranavkm can you elaborate on the type of exception we can expect to see from the jsruntime in the various fail/error conditions, e.g. during timeouts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants