From ddf3a6daedbaa2d3bc344085e89cac428d9e21cf Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Thu, 21 Jan 2021 11:29:39 +1100 Subject: [PATCH] Fix bug with adding tokens when no map is selected --- src/network/NetworkedMapAndTokens.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/network/NetworkedMapAndTokens.js b/src/network/NetworkedMapAndTokens.js index 8d39b50..e056dc8 100644 --- a/src/network/NetworkedMapAndTokens.js +++ b/src/network/NetworkedMapAndTokens.js @@ -273,6 +273,9 @@ function NetworkedMapAndTokens({ session }) { */ async function handleMapTokenStateCreate(tokenState) { + if (!currentMap || !currentMapState) { + return; + } // If file type token send the token to the other peers const token = getToken(tokenState.tokenId); if (token && token.type === "file") {