fix segfault on query non set boundary name in 2D

This commit is contained in:
Christopher Lackner 2018-03-08 14:46:34 +01:00
parent a1d1df91b7
commit bdfbf14a39
2 changed files with 3 additions and 1 deletions

View File

@ -5910,6 +5910,7 @@ namespace netgen
}
string Mesh :: cd2_default_name = "default";
string Mesh :: default_bc = "default";
const string & Mesh :: GetCD2Name (int cd2nr) const
{
static string defaultstring = "default";

View File

@ -625,8 +625,9 @@ namespace netgen
}
size_t GetNCD2Names() const { return cd2names.Size(); }
DLL_HEADER static string default_bc;
string * GetBCNamePtr (int bcnr) const
{ return bcnr < bcnames.Size() ? bcnames[bcnr] : nullptr; }
{ return (bcnr < bcnames.Size() && bcnames[bcnr]) ? bcnames[bcnr] : &default_bc; }
///
void ClearFaceDescriptors()