diff --git a/pcbnew/exporters/export_vrml.cpp b/pcbnew/exporters/export_vrml.cpp index ac23fdf335..8ec682f094 100644 --- a/pcbnew/exporters/export_vrml.cpp +++ b/pcbnew/exporters/export_vrml.cpp @@ -1690,7 +1690,8 @@ static void create_vrml_plane( IFSG_TRANSFORM& PcbOutput, VRML_COLOR_INDEX color std::vector< int > idxPlane; std::vector< int > idxSide; - if( !(*layer).Get2DTriangles( vertices, idxPlane, top_z, aTopPlane ) ) + if( !( *layer ).Get2DTriangles( vertices, idxPlane, top_z, aTopPlane ) || idxPlane.empty() + || idxSide.empty() ) { #ifdef DEBUG do { @@ -1776,7 +1777,8 @@ static void create_vrml_shell( IFSG_TRANSFORM& PcbOutput, VRML_COLOR_INDEX color bottom_z = tmp; } - if( !(*layer).Get3DTriangles( vertices, idxPlane, idxSide, top_z, bottom_z ) ) + if( !( *layer ).Get3DTriangles( vertices, idxPlane, idxSide, top_z, bottom_z ) + || idxPlane.empty() || idxSide.empty() ) { #ifdef DEBUG do {