diff --git a/src/libslic3r/AppConfig.cpp b/src/libslic3r/AppConfig.cpp index 59e236db38..9f174740dc 100644 --- a/src/libslic3r/AppConfig.cpp +++ b/src/libslic3r/AppConfig.cpp @@ -837,6 +837,10 @@ void AppConfig::save() #endif c.close(); + if (c.fail()) { + BOOST_LOG_TRIVIAL(error) << "Failed to write new configuration to " << path_pid << "; aborting attempt to overwrite original configuration"; + return; + } #ifdef WIN32 // Make a backup of the configuration file before copying it to the final destination. @@ -1042,6 +1046,10 @@ void AppConfig::save() c << appconfig_md5_hash_line(config_str); #endif c.close(); + if (c.fail()) { + BOOST_LOG_TRIVIAL(error) << "Failed to write new configuration to " << path_pid << "; aborting attempt to overwrite original configuration"; + return; + } #ifdef WIN32 // Make a backup of the configuration file before copying it to the final destination.