diff --git a/src/lay/lay/layFillDialog.cc b/src/lay/lay/layFillDialog.cc index 4d59325ca..88be20f6f 100644 --- a/src/lay/lay/layFillDialog.cc +++ b/src/lay/lay/layFillDialog.cc @@ -310,7 +310,7 @@ FillDialog::get_fill_parameters () // visible layers for (lay::LayerPropertiesConstIterator l = mp_view->begin_layers (); ! l.at_end (); ++l) { - if (! l->has_children () && l->visible (true)) { + if (! l->has_children () && l->visible (true) && cv->layout ().is_valid_layer (l->layer_index ())) { fp.exclude_layers.push_back (cv->layout ().get_properties (l->layer_index ())); } } @@ -320,7 +320,7 @@ FillDialog::get_fill_parameters () // selected layers std::vector s = mp_view->selected_layers (); for (std::vector::const_iterator l = s.begin (); l != s.end (); ++l) { - if (! (*l)->has_children ()) { + if (! (*l)->has_children () && cv->layout ().is_valid_layer ((*l)->layer_index ())) { fp.exclude_layers.push_back (cv->layout ().get_properties ((*l)->layer_index ())); } }