Index: layer_it.h =================================================================== --- layer_it.h (revision 28094) +++ layer_it.h (revision 28095) @@ -56,7 +56,7 @@ { if (it->global) { /* over all layers, random order, without any checks - go the cheap way, bypassing groups */ - if (it->lidx < pcb_max_layer) + if (it->lidx < pcb_max_layer(PCB)) return it->lidx++; return -1; }