From f93711838fecfc33dbe552617832ebb148a30697 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Thu, 16 Nov 2023 19:22:02 +0000 Subject: [PATCH] Fix 6317967: Missing exception for SetPipRatio(). (#11465) --- src/widget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/widget.cpp b/src/widget.cpp index 53d26e4ac5..b24c259cbc 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -3254,6 +3254,8 @@ static const NWidgetPart *MakeNWidget(const NWidgetPart *nwid_begin, const NWidg NWidgetBackground *nwb = dynamic_cast(*dest); if (nwb != nullptr) nwb->SetPIPRatio(nwid_begin->u.pip.pre, nwid_begin->u.pip.inter, nwid_begin->u.pip.post); + + if (unlikely(nwc == nullptr && nwb == nullptr)) throw std::runtime_error("WPT_PIPRATIO requires NWidgetPIPContainer or NWidgetBackground"); break; }