Index: search.c =================================================================== --- search.c (revision 28107) +++ search.c (revision 28108) @@ -103,7 +103,7 @@ if (!pcb_is_point_in_pstk(PosX, PosY, SearchRadius, ps, NULL)) return PCB_R_DIR_NOT_FOUND; - if ((i->on_current) && (pcb_pstk_shape_at(PCB, ps, CURRENT) == NULL) && (!pcb_pstk_bb_drills(PCB, ps, CURRENT->meta.real.grp, NULL))) + if ((i->on_current) && (pcb_pstk_shape_at(PCB, ps, PCB_CURRLAYER(PCB)) == NULL) && (!pcb_pstk_bb_drills(PCB, ps, PCB_CURRLAYER(PCB)->meta.real.grp, NULL))) return PCB_R_DIR_NOT_FOUND; if ((i->on_lyt != 0) && (pcb_pstk_shape(ps, i->on_lyt, 0) == NULL)) return PCB_R_DIR_NOT_FOUND;