Skip to content

Commit

Permalink
Cannot use null value when saving Site Icon or Site Logo
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregory Liénard authored and Gregory Liénard committed Nov 16, 2023
1 parent 7a9e273 commit 76d74b5
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions WordPressPCL/Models/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,37 @@ public class Settings
public OpenStatus? DefaultCommentStatus { get; set; }


private int? _SiteLogo;
/// <summary>
/// Media ID of the site logo
/// </summary>
[JsonProperty("site_logo")]
public int? SiteLogo { get; set; }

public int? SiteLogo
{
get
{
return _SiteLogo ?? 0;
}
set
{
_SiteLogo = value ?? 0;
}
}

private int? _SiteIcon;
/// <summary>
/// Media ID of the site icon
/// </summary>
[JsonProperty("site_icon")]
public int? SiteIcon { get; set; }
public int? SiteIcon {
get
{
return _SiteIcon ?? 0;
}
set
{
_SiteIcon = value ?? 0;
}
}
}
}

0 comments on commit 76d74b5

Please sign in to comment.