Fix bug with dropping token onto empty map

This commit is contained in:
Mitchell McCaffrey 2020-04-30 16:40:17 +10:00
parent eed8f63b84
commit ce11021e9f

View File

@ -110,8 +110,8 @@ function ProxyToken({
}
let proxy = proxyRef.current;
if (proxy) {
if (onProxyDragEnd) {
const mapImage = document.querySelector(".mapImage");
const mapImage = document.querySelector(".mapImage");
if (onProxyDragEnd && mapImage) {
const mapImageRect = mapImage.getBoundingClientRect();
let x = parseFloat(proxy.getAttribute("data-x")) || 0;