From 62a0ad52347b643031d8ac6d77d4e7584d327e3d Mon Sep 17 00:00:00 2001 From: "zorro.zhang" Date: Fri, 19 Apr 2024 16:01:44 +0800 Subject: [PATCH] FIX: Resume Get Makerlab function JIRA: none Change-Id: Ifcde937d7c9a192984ee884a6cf77c5b2fd6ea38 --- src/slic3r/GUI/GUI_App.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index f909d4cac..46d113cdf 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -4061,7 +4061,7 @@ std::string GUI_App::handle_web_request(std::string cmd) if (root.get_child_optional("data") != boost::none) { pt::ptree data_node = root.get_child("data"); boost::optional id = data_node.get_optional("id"); - if (id.has_value() && mainframe->m_webview) { + if (id.has_value() && mainframe && mainframe->m_webview) { mainframe->m_webview->OpenModelDetail(id.value(), m_agent); } } @@ -4171,7 +4171,7 @@ std::string GUI_App::handle_web_request(std::string cmd) int nRefresh = root.get_child_optional("refresh") == boost::none ? 0 : root.get_optional("refresh").value(); CallAfter([this,strMenu, nRefresh] { - if (mainframe->m_webview) + if (mainframe && mainframe->m_webview) { mainframe->m_webview->SwitchWebContent(strMenu, nRefresh); } @@ -4183,17 +4183,17 @@ std::string GUI_App::handle_web_request(std::string cmd) if (root.get_child_optional("menu") != boost::none) { std::string strMenu = root.get_optional("menu").value(); - if (mainframe->m_webview) { mainframe->m_webview->SwitchLeftMenu(strMenu); } + if (mainframe && mainframe->m_webview) { mainframe->m_webview->SwitchLeftMenu(strMenu); } } } else if (command_str.compare("homepage_makerlab_get") == 0) { - //if (mainframe->m_webview) { mainframe->m_webview->SendMakerlabList(); } + if (mainframe && mainframe->m_webview) { mainframe->m_webview->SendMakerlabList(); } } else if (command_str.compare("homepage_makerlab_open") == 0) { if (root.get_child_optional("url") != boost::none) { std::string strUrl = root.get_optional("url").value(); - if (mainframe->m_webview) { mainframe->m_webview->OpenOneMakerlab(strUrl); } + if (mainframe && mainframe->m_webview) { mainframe->m_webview->OpenOneMakerlab(strUrl); } } } else if (command_str.compare("makerworld_model_open") == 0)