Fix bug with deleteing tokens that have been removed
This commit is contained in:
parent
708a8d3790
commit
31cdbbb8dd
@ -48,7 +48,7 @@ function MapToken({
|
||||
const tokenImage = event.target;
|
||||
const tokenImageRect = tokenImage.getClientRect();
|
||||
|
||||
if (token.isVehicle) {
|
||||
if (token && token.isVehicle) {
|
||||
// Find all other tokens on the map
|
||||
const layer = tokenImage.getLayer();
|
||||
const tokens = layer.find(".token");
|
||||
@ -83,7 +83,7 @@ function MapToken({
|
||||
const tokenImage = event.target;
|
||||
|
||||
const mountChanges = {};
|
||||
if (token.isVehicle) {
|
||||
if (token && token.isVehicle) {
|
||||
const layer = tokenImage.getLayer();
|
||||
const mountedTokens = tokenImage.find(".token");
|
||||
for (let mountedToken of mountedTokens) {
|
||||
|
@ -66,7 +66,7 @@ function TokenDragOverlay({
|
||||
function handleTokenDragEnd() {
|
||||
if (isRemoveHovered) {
|
||||
// Handle other tokens when a vehicle gets deleted
|
||||
if (token.isVehicle) {
|
||||
if (token && token.isVehicle) {
|
||||
const layer = tokenImage.getLayer();
|
||||
const mountedTokens = tokenImage.find(".token");
|
||||
for (let mountedToken of mountedTokens) {
|
||||
|
Loading…
Reference in New Issue
Block a user