Skip to content

Commit

Permalink
Fix null exception if bgm info missing #92
Browse files Browse the repository at this point in the history
  • Loading branch information
drojf committed Oct 30, 2022
1 parent a710aae commit b98499a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions MOD.Scripts.Core.Audio/MODBGMInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ public BGMInfo()
source = "";
url = "";
}

public BGMInfo SetName(string name)
{
this.name = name;
return this;
}
}

public class BGMInfoDict
Expand Down Expand Up @@ -62,9 +68,7 @@ public static BGMInfo GetBGMName(string streamingAssetsRelativePath)
}
else
{
var defaultInfo = new BGMInfo();
info.name = GameSystem.Instance.ChooseJapaneseEnglish("不明 BGM", "Unknown BGM");
return info;
return new BGMInfo().SetName(GameSystem.Instance.ChooseJapaneseEnglish("不明 BGM", "Unknown BGM"));
}
}

Expand Down

0 comments on commit b98499a

Please sign in to comment.