Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/slic3r/Utils/Repetier.cpp')
-rw-r--r--src/slic3r/Utils/Repetier.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/slic3r/Utils/Repetier.cpp b/src/slic3r/Utils/Repetier.cpp
index c3c24c38e..7bae531ea 100644
--- a/src/slic3r/Utils/Repetier.cpp
+++ b/src/slic3r/Utils/Repetier.cpp
@@ -62,11 +62,14 @@ bool Repetier::test(wxString &msg) const
std::stringstream ss(body);
pt::ptree ptree;
pt::read_json(ss, ptree);
-
- const auto text = ptree.get_optional<std::string>("name");
- res = validate_version_text(text);
- if (! res) {
- msg = GUI::from_u8((boost::format(_u8L("Mismatched type of print host: %s")) % (text ? *text : "Repetier")).str());
+
+ res = ptree.get_optional<std::string>("name").has_value();
+ if (!res)
+ msg = GUI::from_u8((boost::format(_u8L("Can't process the repetier return message: missing field '%s'")) % ("name")).str());
+ else {
+ res = ptree.get_optional<std::string>("printers").has_value();
+ if (!res)
+ msg = GUI::from_u8((boost::format(_u8L("Can't process the repetier return message: missing field '%s'")) % ("printers")).str());
}
}
catch (const std::exception &) {