From 838ef038156317921e37d76ea2f2c02a31ea6d5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 1 May 2023 10:37:30 +0200 Subject: [PATCH] Fix ScrollView crash (though the root cause is a race condition most likely) --- Common/UI/ScrollView.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Common/UI/ScrollView.cpp b/Common/UI/ScrollView.cpp index 26833eee73..991f1c25db 100644 --- a/Common/UI/ScrollView.cpp +++ b/Common/UI/ScrollView.cpp @@ -203,6 +203,9 @@ bool ScrollView::Touch(const TouchInput &input) { ScrollView::Bob ScrollView::ComputeBob() const { Bob bob{}; + if (views_.empty()) { + return bob; + } float childHeight = std::max(0.01f, views_[0]->GetBounds().h); float scrollMax = std::max(0.0f, childHeight - bounds_.h); float ratio = bounds_.h / childHeight;