Don't blow up when the pending point doesn't seem to exist; that

happens if we're solving an earlier group than the one that
contains the pending point.

[git-p4: depot-paths = "//depot/solvespace/": change = 1701]
This commit is contained in:
Jonathan Westhues 2008-04-30 22:38:00 -08:00
parent f1c5d07e39
commit b7e8b99f37

View File

@ -87,8 +87,12 @@ void System::SortBySensitivity(void) {
mat.permutation[j] = j; mat.permutation[j] = j;
} }
if(SS.GW.pendingPoint.v) { if(SS.GW.pendingPoint.v) {
Entity *p = SS.GetEntity(SS.GW.pendingPoint); Entity *p = SS.entity.FindByIdNoOops(SS.GW.pendingPoint);
// If we're solving an earlier group, then the pending point might
// not exist in the entity tables yet.
if(p) {
switch(p->type) { switch(p->type) {
case Entity::POINT_XFRMD:
case Entity::POINT_IN_3D: case Entity::POINT_IN_3D:
MarkAsDragged(p->param[0]); MarkAsDragged(p->param[0]);
MarkAsDragged(p->param[1]); MarkAsDragged(p->param[1]);
@ -98,7 +102,7 @@ void System::SortBySensitivity(void) {
MarkAsDragged(p->param[0]); MarkAsDragged(p->param[0]);
MarkAsDragged(p->param[1]); MarkAsDragged(p->param[1]);
break; break;
default: oops(); }
} }
} }