I had a bug report for one of my module which included the attached error message. I am not entirly certain what caused the invalid data to show up but this should prevent the error from coming up again.
Your solution doesn't help as far as I can tell.
layerGetElement returns a canvas placable if it finds one, if not it returns null.
I'll filter for null which should solve it.
I had a bug report for one of my module which included the attached error message. I am not entirly certain what caused the invalid data to show up but this should prevent the error from coming up again.![image](https://github.com/KayelGee/token-attacher/assets/137942782/61ab4326-3273-4412-b233-97950deb5322)