Make cached edge processing more robust

This commit is contained in:
David Kaltschmidt
2016-04-11 11:41:39 +02:00
parent 082754d8c3
commit 5ae87a039b

View File

@@ -297,7 +297,8 @@ function hasSameEndpoints(cachedEdge, nodes) {
const oldTargetPoint = oldPoints.last();
const newSource = nodes.get(cachedEdge.get('source'));
const newTarget = nodes.get(cachedEdge.get('target'));
return (oldSourcePoint.get('x') === newSource.get('x')
return (oldSourcePoint && oldTargetPoint && newSource && newTarget
&& oldSourcePoint.get('x') === newSource.get('x')
&& oldSourcePoint.get('y') === newSource.get('y')
&& oldTargetPoint.get('x') === newTarget.get('x')
&& oldTargetPoint.get('y') === newTarget.get('y'));