Fix #95411: Collada export crashes if temporary file is not accessible
This can happen e.g. when relative "//" is in Preferences > File Paths >
Temporary Files is used.
Now catch the corresponding COLLADASW::StreamWriterException
and cancel export then.
NOTE: 51126fab33
might have prevented the most common case
to run into this crash (but there might be other cases still so being safe
here does not hurt)
Pull Request: https://projects.blender.org/blender/blender/pulls/118958
This commit is contained in:
parent
1906ee76ba
commit
959595069d
|
@ -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 <collada> */
|
||||
writer->startDocument();
|
||||
|
|
Loading…
Reference in New Issue