mirror of
https://github.com/aseprite/aseprite.git
synced 2024-09-02 13:09:27 +00:00
Fix possible crash calling View::getView() with a nullptr widget (#3504)
This commit is contained in:
parent
0eb9e17caf
commit
4643aa6a1b
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user