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

Serialize Map<string, string option> raises "Object reference not set to an instance of an object." #43

Open
codingedgar opened this issue Oct 20, 2020 · 0 comments

Comments

@codingedgar
Copy link

Hello! Currently, I'm trying to serialize this scenario but it raises an error:

type Example = Map<string, string option>

let example: Example = Map.empty

example
|> Map.add "p" None
|> Json.serialize // "Object reference not set to an instance of an object."

When I step with the debugger I see:
image
I guess F# interprets a value of type option as null in maps and it throws?

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

No branches or pull requests

1 participant