Invalid SetBGM value sets bgm to default instead

This commit is contained in:
Raymond Lynch 2021-07-11 20:40:54 -04:00
parent c2295995f0
commit fd645aabfa

View file

@ -221,7 +221,15 @@ namespace Dalamud.Interface.Internal
private void OnBgmSetCommand(string command, string arguments)
{
this.dalamud.Framework.Gui.SetBgm(ushort.Parse(arguments));
if (ushort.TryParse(arguments, out var value))
{
this.dalamud.Framework.Gui.SetBgm(value);
}
else
{
// Revert to the original BGM by specifying an invalid one
this.dalamud.Framework.Gui.SetBgm(9999);
}
}
private void OnDebugDrawDevMenu(string command, string arguments)