prevent reading property 'collides' of undefined

fixes e2e tests
This commit is contained in:
Lukas Hass
2022-02-14 22:07:15 +01:00
parent ae46a1faf1
commit ae8c18fa4b
+3 -1
View File
@@ -336,7 +336,9 @@ export class GameMap {
if (!layer.visible) { if (!layer.visible) {
continue; continue;
} }
if (layer.getTileAt(x, y)?.properties[GameMapProperties.COLLIDES]) { // TODO: use optional chaining when https://github.com/DevExpress/testcafe-hammerhead/issues/2714 is fixed
const properties = layer.getTileAt(x, y)?.properties;
if (properties && properties[GameMapProperties.COLLIDES]) {
return true; return true;
} }
} }