Skip to content

Commit

Permalink
fix: Team is nullable, not optional (discord-net#1672)
Browse files Browse the repository at this point in the history
  • Loading branch information
SubZero0 authored Nov 9, 2020
1 parent 864216b commit 6e24b50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Discord.Net.Rest/API/Common/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal class Application
[JsonProperty("bot_require_code_grant")]
public bool BotRequiresCodeGrant { get; set; }
[JsonProperty("team")]
public Optional<Team> Team { get; set; }
public Team Team { get; set; }

[JsonProperty("flags"), Int53]
public Optional<ulong> Flags { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions src/Discord.Net.Rest/Entities/RestApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ internal void Update(Model model)
Flags = model.Flags.Value; //TODO: Do we still need this?
if (model.Owner.IsSpecified)
Owner = RestUser.Create(Discord, model.Owner.Value);
if (model.Team.IsSpecified && model.Team.Value != null)
Team = RestTeam.Create(Discord, model.Team.Value);
if (model.Team != null)
Team = RestTeam.Create(Discord, model.Team);
}

/// <exception cref="InvalidOperationException">Unable to update this object from a different application token.</exception>
Expand Down

0 comments on commit 6e24b50

Please sign in to comment.