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

Null return issue #2

Open
UnaffiliatedCode opened this issue Feb 23, 2021 · 2 comments
Open

Null return issue #2

UnaffiliatedCode opened this issue Feb 23, 2021 · 2 comments

Comments

@UnaffiliatedCode
Copy link

.Net Core version 3.1 Build
version 1.2.27
File: ServiceNowClient.cs
Line:

(await this.GetDeserializedObjectFromResponse<RestResponse<JObject>>(response, Guid.NewGuid()).ConfigureAwait(false)).Item

This line is replicated in a few places, and causes an issue if the Rest application returns a null. With a status code 200/201/etc.

A nullable check, and return null would suffice for my purposes.
I was going to write the change and submit a P.R. however it appears that you fixed this, but only support .Net version 5.0 with that change.

Can there be a version 3.0 compatible build?

@davidnmbond
Copy link
Contributor

davidnmbond commented Feb 24, 2021

Hi @UnaffiliatedCode!

I'm happy to fix this one, but I could do with understanding the circumstances in which a 200/201 returns null / empty string.
Could you provide a small code snippet?

@UnaffiliatedCode
Copy link
Author

UnaffiliatedCode commented Feb 24, 2021

In my example, this table is a customized set of code that is done for communication between different systems. My calling method is a simple CreateAsync call, that is being managed on the ServiceNow side to return a null (not controllable by me).

So unfortunately, I cannot provide the exact circumstances/code required to replicate on your end. :(

In my use-case, a simple return null would suffice.

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

2 participants