Skip to content

Commit

Permalink
fix: handle undefined values when giving damage
Browse files Browse the repository at this point in the history
There is an issue with unlinked tokens that sometimes the code is trying
to access data  which does not exist. This fix makes prevents this from
happening
  • Loading branch information
jonepatr authored and xdy committed Jan 19, 2021
1 parent 6b13f08 commit f7155b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/module/hooks/updateHits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Hooks.on('preUpdateToken', async (scene, token:Record<string, any>, update:Recor
const actor = TwodsixActor.collection.get(token.actorId);
update.actorData.data.hits = getCurrentHits(
actor.data.data.characteristics,
token.actorData.data.characteristics,
token.actorData?.data?.characteristics ?? {},
update.actorData.data.characteristics
);
}
Expand Down

0 comments on commit f7155b7

Please sign in to comment.