Add back null check

This commit is contained in:
Dan Balasescu 2022-08-15 21:57:35 +09:00
parent c03e47317a
commit 8e0049c005
1 changed files with 1 additions and 1 deletions

View File

@ -77,7 +77,7 @@ private static List<MonoEncoding> encodeMono(List<DifficultyHitObject> data)
TaikoDifficultyHitObject? previousObject = taikoObject.PreviousNote(0);
// If this is the first object in the list or the colour changed, create a new mono encoding
if (currentEncoding == null || (taikoObject.BaseObject as Hit)?.Type != (previousObject?.BaseObject as Hit)?.Type)
if (currentEncoding == null || previousObject == null || (taikoObject.BaseObject as Hit)?.Type != (previousObject.BaseObject as Hit)?.Type)
{
currentEncoding = new MonoEncoding();
encodings.Add(currentEncoding);