mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-04 03:16:11 +00:00
bugfix: improve fallback when StringEnum encounters null value (#2156)
This commit is contained in:
@@ -190,6 +190,18 @@ namespace Octokit.Internal
|
||||
return base.DeserializeObject(value, payloadType);
|
||||
}
|
||||
|
||||
if (ReflectionUtils.IsStringEnumWrapper(type))
|
||||
{
|
||||
// this check is a workaround for https://github.com/octokit/octokit.net/issues/2052
|
||||
// as the API is returning a null value where the enum is
|
||||
// expecting something like a string
|
||||
//
|
||||
// this should be removed once we can confirm the GitHub API
|
||||
// is no longer returning a null for the parent Team's
|
||||
// permission value
|
||||
return Activator.CreateInstance(type, "null");
|
||||
}
|
||||
|
||||
return base.DeserializeObject(value, type);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user