Check for null CatchJudgement

This commit is contained in:
clayton 2018-06-11 13:30:30 -07:00
parent d3ada7914c
commit 785c24b11b
No known key found for this signature in database
GPG Key ID: 27E0498D54E725EB

View File

@ -69,9 +69,8 @@ namespace osu.Game.Rulesets.Catch.Scoring
return;
}
var catchJudgement = judgement as CatchJudgement;
Health.Value += Math.Max(catchJudgement.HealthIncrease - hpDrainRate, 0) * harshness;
if (judgement is CatchJudgement catchJudgement)
Health.Value += Math.Max(catchJudgement.HealthIncrease - hpDrainRate, 0) * harshness;
}
}
}