Skip to content

Commit

Permalink
Handle empty or missing Options
Browse files Browse the repository at this point in the history
  • Loading branch information
angrave committed Dec 11, 2023
1 parent f46882a commit da7de02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ClassTranscribeDatabase/Models/Models.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public class Playlist : Entity
public string Options { get; set; } = "";

public virtual JObject getOptionsAsJson() {
return JObject.Parse(this.Options);
return String.IsNullOrEmpty(this.Options) ? new JObject() : JObject.Parse(this.Options);
}

public virtual void setOptionsAsJson(JObject json) {
Expand Down Expand Up @@ -282,7 +282,7 @@ public class Media : Entity
public string Options { get; set; } = "";

public virtual JObject getOptionsAsJson() {
return JObject.Parse(this.Options);
return String.IsNullOrEmpty(this.Options) ? new JObject() : JObject.Parse(this.Options);
}

public virtual void setOptionsAsJson(JObject json) {
Expand Down

0 comments on commit da7de02

Please sign in to comment.