From 1df362888ee071611c43e87ab5ffbcc27537cbfa Mon Sep 17 00:00:00 2001 From: Lam Wei Lun Date: Tue, 15 Sep 2026 15:47:48 +0800 Subject: [PATCH] Fixes nullptr deref --- src/slic3r/GUI/MediaPlayCtrl.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/MediaPlayCtrl.cpp b/src/slic3r/GUI/MediaPlayCtrl.cpp index ccf0e83b6f..93cfcb4125 100644 --- a/src/slic3r/GUI/MediaPlayCtrl.cpp +++ b/src/slic3r/GUI/MediaPlayCtrl.cpp @@ -402,10 +402,12 @@ void MediaPlayCtrl::Play() return; } default: // assumed to be CameraStreamMode::none - NetworkAgent* agent = wxGetApp().getAgent(); - if (agent && agent->get_printer_agent()->get_agent_info().id != BBL_PRINTER_AGENT_ID) { - Stop(_L("Camera not available")); - return; + if (NetworkAgent* agent = wxGetApp().getAgent()) { + if (auto printer_agent = agent->get_printer_agent()) { + if (printer_agent->get_agent_info().id != BBL_PRINTER_AGENT_ID) { + return; + } + } } break; }