Merge pull request #3126 from smoogipoo/fix-catch-nullref

Fix possible nullref if no fruits are ever caught
This commit is contained in:
ekrctb 2018-07-26 23:05:03 +09:00 committed by GitHub
commit 5b18488174
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -52,6 +52,9 @@ public void OnJudgement(DrawableCatchHitObject fruit, Judgement judgement)
{ {
void runAfterLoaded(Action action) void runAfterLoaded(Action action)
{ {
if (lastPlateableFruit == null)
return;
// this is required to make this run after the last caught fruit runs UpdateState at least once. // this is required to make this run after the last caught fruit runs UpdateState at least once.
// TODO: find a better alternative // TODO: find a better alternative
if (lastPlateableFruit.IsLoaded) if (lastPlateableFruit.IsLoaded)