Skip to content

Commit

Permalink
Added null checks in ChartDialogPatch
Browse files Browse the repository at this point in the history
  • Loading branch information
SB15-MD committed Jan 18, 2024
1 parent f6d28bc commit 1bb924f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Patches/ChartDialogPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ private static void Prefix(DialogMasterControl __instance)
(currentAlbum?.Sheets.TryGetValue(PlayDialogAnimPatch.CurrentStageInfo.difficulty, out var sheet) ?? false) && sheet.TalkFileVersion2;
PlayDialogAnimPatch.Index = 0;
PlayDialogAnimPatch.CurrentLanguage = DataHelper.userLanguage;


if (PlayDialogAnimPatch.CurrentStageInfo.dialogEvents == null) return;
// Set this here to avoid repeatedly checking a dictionary
PlayDialogAnimPatch.DialogEvents =
PlayDialogAnimPatch.CurrentStageInfo.dialogEvents.ContainsKey(PlayDialogAnimPatch.CurrentLanguage)
Expand All @@ -63,7 +64,7 @@ internal class PlayDialogAnimPatch
internal static Il2CppSystem.Collections.Generic.List<GameDialogArgs> DialogEvents { get; set; }
private static void Prefix(DialogSubControl __instance)
{
if (!HasVersion2) return;
if (!HasVersion2 || DialogEvents == null) return;

__instance.m_BgImg.color = DialogEvents[Index++].bgColor;
}
Expand Down

0 comments on commit 1bb924f

Please sign in to comment.