FIX:Fix the crashes when users import 3MF files that use third-party printers.

Jira:STUDIO-13586

Change-Id: I977e9e426e2f2b98da389e7bfa8fb57388c55628
(cherry picked from commit 9d170ebd52a94579a81a9e8bc8eb19ae27ba3076)
This commit is contained in:
weizhen.xie
2025-08-01 15:05:37 +08:00
committed by Noisyfox
parent 95c63e2534
commit fa832b7539
3 changed files with 16 additions and 2 deletions

View File

@@ -1495,8 +1495,10 @@ bool MainFrame::can_send_gcode() const
if (m_plater && !m_plater->model().objects.empty())
{
auto cfg = wxGetApp().preset_bundle->printers.get_edited_preset().config;
if (const auto *print_host_opt = cfg.option<ConfigOptionString>("print_host"); print_host_opt)
return !print_host_opt->value.empty();
const auto *print_host_opt = cfg.option<ConfigOptionString>("print_host");
if (! print_host_opt) return false;
else return !print_host_opt->value.empty();
}
return true;
}