FIX: fix crash when no sec_link

Change-Id: I41aa905b0dcac3d5b162fea5b19a1d2c6aa72b68
Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
Stone Li 2023-04-11 11:58:11 +08:00 committed by Lane.Wei
parent aa6785bde4
commit 4174f361f1
1 changed files with 4 additions and 1 deletions

View File

@ -3888,7 +3888,10 @@ void DeviceManager::on_machine_alive(std::string json_str)
std::string printer_signal = j["dev_signal"].get<std::string>();
std::string connect_type = j["connect_type"].get<std::string>();
std::string bind_state = j["bind_state"].get<std::string>();
std::string sec_link = j["sec_link"].get<std::string>();
std::string sec_link = "";
if (j.contains("sec_link")) {
sec_link = j["sec_link"].get<std::string>();
}
MachineObject* obj;