From 405444f042a05da294e4d4093402decc4ea2f2ab Mon Sep 17 00:00:00 2001 From: "chunmao.guo" Date: Tue, 26 Jul 2022 15:19:28 +0800 Subject: [PATCH] FIX: crash when no WMP Change-Id: I9bab2e73da05125ee2ca24ac13456fbb82e91714 --- src/slic3r/GUI/MediaPlayCtrl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/MediaPlayCtrl.cpp b/src/slic3r/GUI/MediaPlayCtrl.cpp index 7f0625fc2..110c37c5e 100644 --- a/src/slic3r/GUI/MediaPlayCtrl.cpp +++ b/src/slic3r/GUI/MediaPlayCtrl.cpp @@ -233,8 +233,10 @@ void wxMediaCtrl2::DoSetSize(int x, int y, int width, int height, int sizeFlags) BOOST_LOG_TRIVIAL(info) << "wxMediaCtrl2::DoSetSize: width: " << width << ", height: " << height << ", maxHeight: " << maxHeight; SetMaxSize({-1, maxHeight}); Slic3r::GUI::wxGetApp().CallAfter([this] { - GetParent()->Layout(); - GetParent()->Refresh(); + if (auto p = GetParent()) { + p->Layout(); + p->Refresh(); + } }); } }