Skip to content

Commit

Permalink
Tweak NameCredit.ToString().
Browse files Browse the repository at this point in the history
  • Loading branch information
Zastai committed May 5, 2020
1 parent 260e873 commit 3c940be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion MetaBrainz.MusicBrainz/Objects/Entities/NameCredit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ internal sealed class NameCredit : JsonBasedObject, INameCredit {

public override string ToString() {
var text = string.Empty;
if (this.Artist != null && this.Artist.Name != this.Name)
if (this.Artist != null && this.Name != null && this.Artist.Name != this.Name)
text += $"[{this.Artist} as “{this.Name}”]";
else if (this.Artist != null)
text += this.Artist.ToString();
else if (this.Name != null)
text += this.Name;
if (this.JoinPhrase != null)
Expand Down

0 comments on commit 3c940be

Please sign in to comment.