tidy5e-sheet icon indicating copy to clipboard operation
tidy5e-sheet copied to clipboard

Thousands of errors during dnd5e system migration (game.actors.get(...) is undefined)

Open cs96and opened this issue 4 years ago • 3 comments

I just installed the dnd5e v1.4.3 update, and during the migration I got thousands of errors on the console, e.g...

image

cs96and avatar Sep 08 '21 10:09 cs96and

I have updated the 5e system with the sheet and lib-wrapper active without any issue. Twice. So I'm sorry to say that I don't have a clue what's going on there.

sdenec avatar Sep 08 '21 11:09 sdenec

Since this seems to have been an isolated issue that I can't replicate I guess it was something unique to your setup. I'm going to close this issue for now.

sdenec avatar Sep 18 '21 10:09 sdenec

I still get thousands of these errors every time I update the dnd5e system. I've tracked it down to when it updates the actors in compendia. The rogue line of code is...

if (game.actors.get(actorEntity.data._id).data.type !== "character")

The actor does not exist in the world, so the game.actors.get() call returns undefined. However I don't think there is any need to call game.actors.get(), you can directly reference actorEntity.data.type, like so...

if (actorEntity.data.type !== "character")

Alternatively, I'm not sure if updateExhaustion() needs to be run on actors in compendia at all. Maybe updateExhausion() should just return if game.actors.get(actorEntity.data._id) returns undefined?

cs96and avatar Jun 07 '22 17:06 cs96and

Is this by any chance solved with the update - or maybe solved itself before that?

sdenec avatar Jan 29 '23 13:01 sdenec

I did not get these errors on the dnd 2.1 migration, so I assume it is fixed.

cs96and avatar Jan 31 '23 15:01 cs96and