fix crash in OMWriter when writing an empty mesh with colors

This commit is contained in:
Max Lyon
2015-12-14 11:55:28 +01:00
parent 338086152b
commit d0033f9966

View File

@@ -248,7 +248,7 @@ bool _OMWriter_::write_binary(std::ostream& _os, BaseExporter& _be,
}
// ---------- write vertex color
if (_opt.check( Options::VertexColor ) && _be.has_vertex_colors() )
if (_be.n_vertices() && _opt.check( Options::VertexColor ) && _be.has_vertex_colors() )
{
Vec3uc c = _be.color(VertexHandle(0));