refactor: Make out variables inline

json-serializing-nullable-fields-issue
Robert Dailey 10 months ago
parent c9d015f492
commit c713b99747

@ -42,11 +42,8 @@ public class SonarrReleaseProfileCompatibilityHandler : ISonarrReleaseProfileCom
public SonarrReleaseProfile CompatibleReleaseProfileForReceiving(JObject profile) public SonarrReleaseProfile CompatibleReleaseProfileForReceiving(JObject profile)
{ {
JSchema? schema; var schema = JSchema.Parse(SonarrReleaseProfileSchema.V2);
IList<string>? errorMessages; if (profile.IsValid(schema, out IList<string>? errorMessages))
schema = JSchema.Parse(SonarrReleaseProfileSchema.V2);
if (profile.IsValid(schema, out errorMessages))
{ {
return profile.ToObject<SonarrReleaseProfile>() return profile.ToObject<SonarrReleaseProfile>()
?? throw new InvalidDataException("SonarrReleaseProfile V2 parsing failed"); ?? throw new InvalidDataException("SonarrReleaseProfile V2 parsing failed");

Loading…
Cancel
Save