From c3be720eb096380db01407dd0aacd8536ddd1ad6 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 6 Dec 2020 09:27:11 -0800 Subject: [PATCH] Avoid potential crash without storage permissions. We conditionally create this view. --- UI/MainScreen.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 1fd5df3f43..da45fc83df 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -1050,6 +1050,7 @@ void MainScreen::CreateViews() { leftColumn->Add(new Spacer(new LinearLayoutParams(0.1f))); } } else { + scrollAllGames_ = nullptr; if (!showRecent) { leftColumn = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 1.0f)); // Just so it's destroyed on recreate. @@ -1203,7 +1204,9 @@ void MainScreen::update() { RecreateViews(); lastVertical_ = vertical; } - g_Config.fGameListScrollPosition = scrollAllGames_->GetScrollPosition(); + if (scrollAllGames_) { + g_Config.fGameListScrollPosition = scrollAllGames_->GetScrollPosition(); + } } bool MainScreen::UseVerticalLayout() const {