Fix crash on DPI change for wxStaticBox without a control label

Check that we have a label before repositioning it fix the crash
introduced by 54684be79d (Fix position of label window in wxStaticBox
after DPI change, 2023-08-05).

See #23740, #23826.

(cherry picked from commit 329d35b922aa893c292d14061fb099aacb4af20b)
This commit is contained in:
Vadim Zeitlin 2023-08-26 23:22:03 +02:00
parent 2280406c30
commit 537dc5f290

View File

@ -310,7 +310,8 @@ WXLRESULT wxStaticBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPar
void wxStaticBox::OnDPIChanged(wxDPIChangedEvent& WXUNUSED(event))
{
PositionLabelWindow();
if ( m_labelWin )
PositionLabelWindow();
}
// ----------------------------------------------------------------------------