Fix #95411: Collada export crashes if temporary file is not accessible #118958
|
@ -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();
|
||||
lichtwerk marked this conversation as resolved
Outdated
|
||||
fprintf(stderr, "Collada: No Objects will be exported.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* open <collada> */
|
||||
writer->startDocument();
|
||||
|
|
Loading…
Reference in New Issue
Files can fail to be created for many reasons, this only addresses not having permissions.
It would be better to catch the
COLLADASW::StreamWriterException
.