Skip to content

Commit 5162d41

Browse files
committed
DM-7088: branch revielded a bug with pointEquals. It needs to handles nil values. fixed.
1 parent e7da53f commit 5162d41

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/firefly/js/visualize/Point.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
import {isString} from 'lodash';
2+
import {isString, isNil} from 'lodash';
33
import CoordinateSys from './CoordSys.js';
44
import Resolver, {parseResolver} from '../astro/net/Resolver.js';
55
import validator from 'validator';
@@ -199,6 +199,9 @@ export const makeOffsetPt= function(x,y) {
199199
};
200200

201201
export const pointEquals= function(p1,p2) {
202+
if (isNil(p1) && isNil(p2)) return true;
203+
else if (isNil(p1) || isNil(p2)) return false;
204+
202205
return (p1.x===p2.x && p1.y===p2.y && p1.type===p2.type && p1.csys===p2.csys);
203206
};
204207

0 commit comments

Comments
 (0)