Index: obj_pstk_inlines.h =================================================================== --- obj_pstk_inlines.h (revision 21117) +++ obj_pstk_inlines.h (revision 21118) @@ -160,6 +160,11 @@ return PCB_BB_INVALID; } + if ((topi < 0) || (boti < 0)) { + /* special case: if there's no top or bottom copper, we do not know where to count from - do not support bbvias */ + return PCB_BB_THRU; + } + if (top != NULL) *top = pcb->LayerGroups.cache.copper[topi]; if (bottom != NULL) *bottom = pcb->LayerGroups.cache.copper[boti];