diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp index 2f203b52541..4a7c004be2b 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp @@ -196,6 +196,11 @@ Polyhedron_demo_c3t3_binary_io_plugin:: save(QFileInfo fileinfo, QList &items) { Scene_item* item = items.front(); + if(!qobject_cast(item)->is_valid()) + { + QMessageBox::warning(CGAL::Three::Three::mainWindow(), "", "The c3t3_item is not valid. You cannot save it."); + return false; + } const Scene_c3t3_item* c3t3_item = qobject_cast(item); if ( NULL == c3t3_item ) {