Advertisement Create a free account

Error when moving tokens

1560291874
I get this error everytime a token moves. I have cleared everything browser wise. Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your scripts and click the "Save Script" button and we'll attempt to start running them again.  More info... For reference, the error message generated was:  TypeError: Cannot read property 'id' of undefined TypeError: Cannot read property 'id' of undefined at handleGraphicMovement (apiscript.js:7981:28) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:151:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:151:1), <anonymous>:70:8) at TrackedObj.set (/home/node/d20-api-server/api.js:1020:14) at updateLocalCache (/home/node/d20-api-server/api.js:1318:18) at /home/node/d20-api-server/api.js:1502:11 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) at Rd.Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425) Here are the scripts I have running Script Library G  5th Edition OGL by Roll20 Companion Limit HP Min Max G  TokenNameNumber G  GMSheet TokenAction G  TokenMod G  MonsterHitDice G  TokenLock G  Bump G  GroupCheck G  GroupInitiative RecursiveTable.js DeathTracker G  MapChange G  Message of the Day CombatTracker Concentration StatusInfo GM_Roll_Announcer ApplyDamage GetAPL G  Vector Math G  splitArgs G  HTML Builder G  Character Sheet Utils G  Check It Out AddPlayerCharacter Claim character It has been happening on and off for a couple of weeks. Any suggestion or ideas on how to fix?
1560293358
Seems to be with Combat Tracker
1560301136
The Aaron
Forum Champion
API Scripter
Changing line 941 to this: getCurrentTurn = () => { return (getTurnorder().shift())||{id:null}; }, will fix it.  The issue is that the turnorder can be empty, in which case it isn't returning a valid object with an id property.  This short defaults it to return an object (Null Object Pattern FTW!).
1560307742
Cool I will try that out. Thank you.
1560344464

Edited 1560344498
Still getting an error now it is this one.  ALso I am using the 2.7 one not the one click install. For reference, the error message generated was: TypeError: Cannot read property 'id' of undefined TypeError: Cannot read property 'id' of undefined     at handleGraphicMovement (apiscript.js:12439:25)     at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:151:1), <anonymous>:65:16)     at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:151:1), <anonymous>:70:8)     at TrackedObj.set (/home/node/d20-api-server/api.js:1020:14)     at updateLocalCache (/home/node/d20-api-server/api.js:1318:18)     at /home/node/d20-api-server/api.js:1502:11     at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560     at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147)     at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546)     at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489)     at Rd.Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425)
1560376316
It does seem to work fine when something is in the turn trackers. But it is now happening when a token is brought on to the table as well.
1560381379
The Aaron
Forum Champion
API Scripter
Hmm. I'll have to install it and give it a try.