prevent reading property 'collides' of undefined
fixes e2e tests
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user