use optional chaining

This commit is contained in:
Lukas Hass
2022-02-19 20:25:17 +01:00
parent e8d5335bc0
commit 3ee9b26650
+1 -3
View File
@@ -348,9 +348,7 @@ export class GameMap {
if (!layer.visible) { if (!layer.visible) {
continue; continue;
} }
// TODO: use optional chaining when https://github.com/DevExpress/testcafe-hammerhead/issues/2714 is fixed if (layer.getTileAt(x, y)?.properties?.[GameMapProperties.COLLIDES]) {
const properties = layer.getTileAt(x, y)?.properties;
if (properties && properties[GameMapProperties.COLLIDES]) {
return true; return true;
} }
} }