jamespdaily / pf2e-sheet-skill-actions

0 stars 14 forks source link

Opening other actor types than characters gets one errors in the console #1

Closed xdy closed 2 years ago

xdy commented 2 years ago

E.g.:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'modifier')
[Detected 1 package: pf2e-sheet-skill-actions]
    at new SkillAction (modules/pf2e-sheet-skill-actions/module/sheet-skill-actions.js:19)
    at initializeSkillActions (modules/pf2e-sheet-skill-actions/module/sheet-skill-actions.js:63)
    at modules/pf2e-sheet-skill-actions/module/sheet-skill-actions.js:53
    at Function._call (foundry.js:294)
    at Function.call (foundry.js:279)
    at FamiliarSheetPF2e._render (foundry.js:3086)
    at async FamiliarSheetPF2e._render (foundry.js:3733)

As this module is probably not very useful for anything but characters you might want to consider adding something like this in the renderActorSheet hook.

  if (app.actor.type !== 'character') {
    return;
  }
jamespdaily commented 2 years ago

Hey xdy, thanks for catching this I'll add in a fix shortly