Skip to content

Commit

Permalink
make an early check for null caster in OnRollSavingThrowOath
Browse files Browse the repository at this point in the history
  • Loading branch information
ThyWoof committed Dec 2, 2023
1 parent b38a056 commit 51ff284
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -751,14 +751,14 @@ internal static void OnRollSavingThrowOath(
string selfConditionName,
ConditionDefinition conditionDefinitionEnemy)
{
if (sourceDefinition is not SpellDefinition { castingTime: ActivationTime.Action } &&
sourceDefinition is not FeatureDefinitionPower { RechargeRate: RechargeRate.ChannelDivinity } &&
!caster.AllConditions.Any(x => x.Name.Contains("Smite")))
if (caster == null || !caster.HasAnyConditionOfType(selfConditionName) || caster.Side == target.Side)
{
return;
}

if (caster == null || !caster.HasAnyConditionOfType(selfConditionName) || caster.Side == target.Side)
if (sourceDefinition is not SpellDefinition { castingTime: ActivationTime.Action } &&
sourceDefinition is not FeatureDefinitionPower { RechargeRate: RechargeRate.ChannelDivinity } &&
!caster.AllConditions.Any(x => x.Name.Contains("Smite")))
{
return;
}
Expand Down

0 comments on commit 51ff284

Please sign in to comment.