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

Getting NullReferenceException from Sitelet.InferWithCustomErrors #902

Closed
lierdakil opened this issue Feb 7, 2018 · 4 comments
Closed

Comments

@lierdakil
Copy link

Here's a relevant portion of the backtrace:

[NullReferenceException: object reference not set to an instance of an object.]
   WebSharper.Sitelets.ServerInferredOperators.IWithCustomErrors(Type typ, InferredRouter item) +164
   WebSharper.Sitelets.Router.IInferWithCustomErrors() +57
   WebSharper.Sitelets.SiteletModule.InferWithCustomErrors(FSharpFunc`2 handle) +81

Let me know if I can help debug this.

@Jand42
Copy link
Member

Jand42 commented Feb 7, 2018

Thanks for the report!

As a quick workaround, try Sitelet.Infer<ParseRequestResult<T>> instead, where T is your endpoint type.
This should be equivalent, only there is a bug currently in InferWithCustomErrors.

@Jand42 Jand42 added the bug label Feb 7, 2018
@Jand42
Copy link
Member

Jand42 commented Feb 7, 2018

Ok, sorry, not entirely equivalent, because InferWithCustomErrors also fixes up the Context object to create links for type T instead of ParseRequestResult<T>.

You can do this too with let ctx = (Context.Map ParseRequestResult.Success ctx).

@lierdakil
Copy link
Author

Thanks for quick response and for suggesting a workaround!

@Jand42
Copy link
Member

Jand42 commented Feb 7, 2018

@lierdakil Fix is now released in 4.1.6.207.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants