mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-31 03:22:01 +08:00
Fixed crash when loading invalid 3MFs (SPE-2135)
The crash was introduced in 040a846, which completely threw away handling of the return value of the importer.load_model_from_file function and replaced it with weaker condition. The purpose of that change was to solve #8401 (missing error message when loading different invalid 3MF). This commit reverts that change (and reintroduces #8401). Handling of 3MF loading errors should be inside the importer.load_model_from_file function, where the check should be added later.
This commit is contained in:
parent
054e932d34
commit
83a98d43bf
@ -3574,11 +3574,11 @@ bool load_3mf(const char* path, DynamicPrintConfig& config, ConfigSubstitutionCo
|
||||
// All import should use "C" locales for number formatting.
|
||||
CNumericLocalesSetter locales_setter;
|
||||
_3MF_Importer importer;
|
||||
importer.load_model_from_file(path, *model, config, config_substitutions, check_version);
|
||||
bool res = importer.load_model_from_file(path, *model, config, config_substitutions, check_version);
|
||||
importer.log_errors();
|
||||
handle_legacy_project_loaded(importer.version(), config, importer.prusaslicer_generator_version());
|
||||
|
||||
return !model->objects.empty() || !config.empty();
|
||||
return res;
|
||||
}
|
||||
|
||||
bool store_3mf(const char* path, Model* model, const DynamicPrintConfig* config, bool fullpath_sources, const ThumbnailData* thumbnail_data, bool zip64)
|
||||
|
Loading…
x
Reference in New Issue
Block a user