Fix potential error in crossing ways validation

This commit is contained in:
Quincy Morgan
2020-04-14 15:52:05 -07:00
parent d7e5aa6735
commit ef48fb0c50

View File

@@ -307,8 +307,9 @@ export function validationCrossingWays(context) {
(!member.role || member.role === 'outer' || member.role === 'inner')) {
var entity = graph.hasEntity(member.id);
// don't add duplicates
if (!entity || array.indexOf(entity) !== -1) return;
array.push(entity);
if (entity && array.indexOf(entity) === -1) {
array.push(entity);
}
}
return array;
}, []);