From 65e5e2a2097a7cb951c195451ae13b34acd97dfd Mon Sep 17 00:00:00 2001 From: minenice55 Date: Fri, 28 Jul 2023 22:20:40 -0400 Subject: [PATCH] don't crash if origin is undefined (#513) reword the unknown origin message to be less scary --- Assets/Scripts/GameManager.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index b5d89bc0a..b236959f9 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -259,7 +259,9 @@ namespace HeavenStudio Debug.Log(Beatmap.data.riqOrigin); if (Beatmap.data.riqOrigin != "HeavenStudio") { - GlobalGameManager.ShowErrorMessage("Warning", "This chart was made for another game,\nand thus may not be playable in Heaven Studio.\nYou may be able to edit this chart in Heaven Studio to be used in its original game.\n\nChart Origin: " + Beatmap.data.riqOrigin.DisplayName()); + string origin = Beatmap.data.riqOrigin?.DisplayName() ?? "Unknown Origin"; + GlobalGameManager.ShowErrorMessage("Warning", + $"This chart came from\n{origin}\nand uses content not included in Heaven Studio.\n\nYou may be able to edit this chart in Heaven Studio to be used in its original program."); } } }