Fixed potential crash in Far::StencilTableFactory

Now StencilTableFactory::AppendLocalPointStencilTable() does
nothing when the localPointStencilTable is empty. This avoids
a potential crash (failed assertion) when both the baseStencilTable
and the localPointStencilTable are empty, as is the case for
simple geometry like the all-quads torus regression test shape.
This commit is contained in:
David G. Yu 2015-11-18 18:01:37 -08:00
parent cf7135eb2a
commit d1b9e45c13

View File

@ -212,7 +212,8 @@ StencilTableFactory::AppendLocalPointStencilTable(
// factorize and append. // factorize and append.
if (baseStencilTable == NULL or if (baseStencilTable == NULL or
localPointStencilTable == NULL) return NULL; localPointStencilTable == NULL or
localPointStencilTable->GetNumStencils() == 0) return NULL;
// baseStencilTable can be built with or without singular stencils // baseStencilTable can be built with or without singular stencils
// (single weight of 1.0f) as place-holders for coarse mesh vertices. // (single weight of 1.0f) as place-holders for coarse mesh vertices.