mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
ISSUE #6340 check if material is null before trying to get id
This commit is contained in:
committed by
Thomas Krijnen
parent
e16d8907f3
commit
dc84d85f7b
@@ -544,7 +544,8 @@ void HdfSerializer::write_style(surface_style_serialization& data, const ifcopen
|
|||||||
data.name = s.name.c_str();
|
data.name = s.name.c_str();
|
||||||
// @todo
|
// @todo
|
||||||
data.original_name = s.name.c_str();
|
data.original_name = s.name.c_str();
|
||||||
data.id = s.instance->as<IfcUtil::IfcBaseClass>()->id();
|
auto instance = s.instance->as<IfcUtil::IfcBaseClass>();
|
||||||
|
data.id = instance ? instance->id() : 0;
|
||||||
if (s.diffuse) {
|
if (s.diffuse) {
|
||||||
data.diffuse[0] = s.diffuse.ccomponents()(0);
|
data.diffuse[0] = s.diffuse.ccomponents()(0);
|
||||||
data.diffuse[1] = s.diffuse.ccomponents()(1);
|
data.diffuse[1] = s.diffuse.ccomponents()(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user