Index: decide.c =================================================================== RCS file: /home/cvs/soar/kernel/decide.c,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 --- decide.c 2002/10/21 23:20:43 1.1 +++ decide.c 2002/10/21 23:30:14 1.1.2.1 @@ -2722,12 +2722,14 @@ #endif } wme_matching_this_cond->gds = inst->match_goal->id.gds; - insert_at_head_of_dll(wme_matching_this_cond->gds->wmes_in_gds, - wme_matching_this_cond, gds_next, - gds_prev); - #ifdef DEBUG_GDS - print("\n .....GDS' goal is NIL so switching from old to new GDS list....\n"); - #endif + if (inst->match_goal->id.gds) { + insert_at_head_of_dll(wme_matching_this_cond->gds->wmes_in_gds, + wme_matching_this_cond, gds_next, + gds_prev); + #ifdef DEBUG_GDS + print("\n .....GDS' goal is NIL so switching from old to new GDS list....\n"); + #endif + } } else if (wme_matching_this_cond->gds->goal->id.level > inst->match_goal_level) { @@ -2761,7 +2763,7 @@ #endif wme_matching_this_cond->gds = inst->match_goal->id.gds; } - } else { + } else if (inst->match_goal->id.gds) { /* We know that the WME should be in the GDS of the current * goal if the WME's GDS does not already exist. * (i.e., if NIL GDS) */ @@ -2893,7 +2895,7 @@ #endif fake_inst_wme_cond->gds = inst->match_goal->id.gds; } - } else { + } else if (inst->match_goal->id.gds) { /* We know that the WME should be in the GDS of * the current goal if the WME's GDS does not * already exist. (i.e., if NIL GDS) */