diff --git a/source/blender/io/collada/DocumentExporter.cpp b/source/blender/io/collada/DocumentExporter.cpp index f2039a3d7aa..68f05180da3 100644 --- a/source/blender/io/collada/DocumentExporter.cpp +++ b/source/blender/io/collada/DocumentExporter.cpp @@ -19,6 +19,7 @@ #include "COLLADASWColorOrTexture.h" #include "COLLADASWConstants.h" #include "COLLADASWEffectProfile.h" +#include "COLLADASWException.h" #include "COLLADASWImage.h" #include "COLLADASWInputList.h" #include "COLLADASWInstanceCamera.h" @@ -171,7 +172,15 @@ int DocumentExporter::exportCurrentScene() clear_global_id_map(); COLLADABU::NativeString native_filename = make_temp_filepath(nullptr, ".dae"); - COLLADASW::StreamWriter *writer = new COLLADASW::StreamWriter(native_filename); + COLLADASW::StreamWriter *writer; + try { + writer = new COLLADASW::StreamWriter(native_filename); + } + catch (COLLADASW::StreamWriterException &e) { + e.printMessage(); + fprintf(stderr, "Collada: No Objects will be exported.\n"); + return 1; + } /* open */ writer->startDocument();