use optional chaining

This commit is contained in:
Lukas Hass 2022-02-19 20:25:17 +01:00
parent e8d5335bc0
commit 3ee9b26650
No known key found for this signature in database
GPG Key ID: 7C8CEF72C4039178

View File

@ -348,9 +348,7 @@ export class GameMap {
if (!layer.visible) {
continue;
}
// 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]) {
if (layer.getTileAt(x, y)?.properties?.[GameMapProperties.COLLIDES]) {
return true;
}
}