Fix possible crash calling View::getView() with a nullptr widget (#3504)

This commit is contained in:
David Capello 2022-11-08 21:13:26 -03:00
parent 0eb9e17caf
commit 4643aa6a1b

View File

@ -207,6 +207,13 @@ private:
gfx::Rect pinBounds(const gfx::Rect& bounds) {
auto theme = SkinTheme::get(this);
ui::Style* pinStyle = theme->styles.recentFilePin();
// We've received some crash reports where it looks like the
// parent() is nullptr.
ASSERT(parent());
if (!parent())
return gfx::Rect();
ui::View* view = View::getView(parent());
const gfx::Size pinSize = theme->calcSizeHint(this, pinStyle);
const gfx::Rect vp = view->viewportBounds();