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

Serialiser_Engine: Fix ToJson() method for when input is null #1222

Merged

Conversation

adecler
Copy link
Member

@adecler adecler commented Sep 25, 2019

Issues addressed by this PR

Closes #1221

Test files

See issue #1221

@adecler adecler added the type:bug Error or unexpected behaviour label Sep 25, 2019
@adecler adecler self-assigned this Sep 25, 2019
@adecler adecler requested a review from epignatelli September 25, 2019 13:34
@adecler
Copy link
Member Author

adecler commented Sep 25, 2019

@BingWangUS, FYI.
I cannot add you as a reviewer for some reason.

@adecler adecler requested a review from alelom September 25, 2019 13:36
@FraserGreenroyd FraserGreenroyd changed the title Fix ToJson() method for when input is null Serialiser_Engine: Fix ToJson() method for when input is null Sep 25, 2019
@michaldengusiak michaldengusiak self-requested a review September 25, 2019 20:28
Copy link
Member

@michaldengusiak michaldengusiak left a comment

Choose a reason for hiding this comment

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

to help with testing,
I tested on provided example and it is working for me

image

Copy link
Member

@epignatelli epignatelli left a comment

Choose a reason for hiding this comment

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

Tested with empty lists and nulls - all ok.

I think @BingWangUS's point in ' though was to be more explicit with a message on why it is failing?

@adecler adecler merged commit 950ff73 into master Sep 26, 2019
@adecler adecler deleted the Serialiser_Engine-Issue1221-ToJsonFailsWhenInputIsNull branch September 26, 2019 11:04
@BingWangUS
Copy link
Contributor

Hi team,

Thanks for responding to this. However, it does not solved the bug for me, when using 2.4 alpha 66 installer, assuming this is included.

See the attach screenshot. I did not open Revit so clearly the pull function is giving empty data output. Therefore, the ToJson component is also taking empty inputs. Here is the error message:

"1. This component failed to run properly. Are you sure you have the correct type of inputs?
Check their description for more details. Here is the error provided by the method:
C# null values of type 'BsonDocument' cannot be serialized using a serializer of type 'BsonDocumentSerializer'."

The error message is misleading since it says not correct input at the beginning instead of no input. I was expecting a warning message as the second ToJson component says. See the test file here.
JsonError.zip

image

I understand this is a small issue because the error message also says null values. So feel free to discard this.

@michaldengusiak
Copy link
Member

You need to connect type to you filter request ie Environment.Elements.Building

@BingWangUS
Copy link
Contributor

Thanks Michal. However, my point is, in any case the pull function is not working in this situation and not giving any data out, so the ToJson component should perform the same as the second ToJson, which I don't understand why not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Error or unexpected behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ToJson() throws exception when input is null
4 participants