-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix Null Reference when Schema is null in a specific circumstance. #3203
Conversation
catch up
Update to 11.3.4
update from rsuter
Update Nswag fork from RSuter
Update master to latest NSwag
Merge origional into master.
Merge 12.0.17
merge ricosuter with master
merge latest from ricoSuter 20190912
merge latest 20191213
Merge latest from NSwag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what the behavior should be here, I don't have enough context, but the change seems to improve null safety here
I'd like to merge but there are conflicts. Can you fix those? |
It looks like the conflicts are from equivalent code that you commited an hour before your comment. See below.
|
I think the more verbose one is better. |
Merge RicoSuter master into ours
@RicoSuter Merge conflict fixed. |
Thx. |
The GetTypeName function handles a null Schema when it is passed in but the hint parameter is attempting to use the Schema assuming it is not null. This is where the NullReferenceException is generated. With a couple of extra lines of code, that case is handled.
The other option is to make the GetTypeName hint default with null and inside the method if Schema is not null but hint is null. Then do the code, "hint = !response.Value.Schema.HasTypeNameTitle ? "Response" : null"