浏览代码

fix null access on js (close #483)

ncannasse 6 年之前
父节点
当前提交
ee1298290f
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      h2d/col/Voronoi.hx

+ 2 - 2
h2d/col/Voronoi.hx

@@ -1577,8 +1577,8 @@ class Voronoi {
 		var eid = 0;
 		for( e in edges ) {
 			e.id = eid++;
-			e.lCell = pointCell.get(e.lPoint);
-			e.rCell = pointCell.get(e.rPoint);
+			e.lCell = e.lPoint == null ? null : pointCell.get(e.lPoint);
+			e.rCell = e.rPoint == null ? null : pointCell.get(e.rPoint);
 		}
 
 		// to measure execution time