SPE-2736: Fixed loading of empty project

This commit is contained in:
Lukas Matena 2025-04-02 17:10:47 +02:00
parent 227fce631a
commit 2b602e8fdf

View File

@ -70,7 +70,7 @@ static Model read_model_from_file(const std::string& input_file, LoadAttributes
if (!result)
throw Slic3r::RuntimeError(L("Loading of a model file failed."));
if (model.objects.empty())
if (model.objects.empty() && temp_config.empty())
throw Slic3r::RuntimeError(L("The supplied file couldn't be read because it's empty"));
if (!boost::ends_with(input_file, ".printRequest"))
@ -105,7 +105,7 @@ static Model read_all_from_file(const std::string& input_file,
if (!result)
throw Slic3r::RuntimeError(L("Loading of a model file failed."));
if (model.objects.empty())
if (model.objects.empty() && config->empty())
throw Slic3r::RuntimeError(L("The supplied file couldn't be read because it's empty"));
for (ModelObject* o : model.objects)