From 427e94bb9101893eeb9a7a4e3bb305d0dcbe69f0 Mon Sep 17 00:00:00 2001
From: Amanda Ghassaei <amandaghassaei@gmail.com>
Date: Thu, 29 Oct 2015 02:06:56 -0400
Subject: [PATCH] small changes

---
 js/cells/GIKCell.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/js/cells/GIKCell.js b/js/cells/GIKCell.js
index ff023e9c..f9563e7c 100644
--- a/js/cells/GIKCell.js
+++ b/js/cells/GIKCell.js
@@ -26,28 +26,32 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'cubeCell'],
 
         if (lattice.get("partType") == "willLego") {
             require(['gikPart'], function(PartSubclass){
+                if (!self.index) return;
                 parts.push(new PartSubclass(self.index.x, self));
                 callback(parts);
             });
         } else if (lattice.get("partType") == "willLegoLowPoly") {
             require(['gikPartLowPoly'], function(PartSubclass){
+                if (!self.index) return;
                 parts.push(new PartSubclass(self.index.x, self));
                 callback(parts);
             });
         } else if (lattice.get("partType") == "lego") {
             require(['legoPart'], function(PartSubclass){
+                if (!self.index) return;
                 parts.push(new PartSubclass(self.index.x, self));
                 callback(parts);
             });
         } else if (lattice.get("partType") == "dnaLego") {
             require(['dnaLegoPart'], function(PartSubclass){
+                if (!self.index) return;
                 parts.push(new PartSubclass(self.index.x, self));
                 callback(parts);
             });
         } else if (lattice.get("partType") == "dnaStraight") {
             require(['dnaStraightPart'], function(PartSubclass){
+                if (!self.index) return;
                 var parent = lattice.getUItarget();
-                parent._parseSparseCell();//todo this should get checked
                 var index = self.getLatticeIndex();
                 if (parent.cells[index.x][index.y][index.z+1]) var topNeighbor = parent.cells[index.x][index.y][index.z+1];
                 if (parent.cells[index.x][index.y][index.z-1]) var bottomNeighbor = parent.cells[index.x][index.y][index.z-1];
-- 
GitLab