From 6d0a9231869e5663ffb5bba379e7c95b31449b7c Mon Sep 17 00:00:00 2001 From: StackZ <47382115+SuperSaiyajinStackZ@users.noreply.github.com> Date: Thu, 24 Dec 2020 00:20:14 +0100 Subject: [PATCH] MainScreen: check `this->entries.size() > 0`. --- source/screens/mainScreen.cpp | 4 ++-- source/store/markMenu.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/screens/mainScreen.cpp b/source/screens/mainScreen.cpp index c020a67..abe3352 100644 --- a/source/screens/mainScreen.cpp +++ b/source/screens/mainScreen.cpp @@ -238,11 +238,11 @@ void MainScreen::Logic(u32 hDown, u32 hHeld, touchPosition touch) { switch(this->storeMode) { case 0: - if (this->store && this->store->GetValid()) StoreUtils::EntryHandle(this->showMarks, this->fetchDown, this->screenshotFetch, this->storeMode); + if (this->store && this->store->GetValid() && this->entries.size() > 0) StoreUtils::EntryHandle(this->showMarks, this->fetchDown, this->screenshotFetch, this->storeMode); break; case 1: - if (this->store && this->store->GetValid()) StoreUtils::DownloadHandle(this->store, this->entries[this->store->GetEntry()], this->dwnldList, this->storeMode, this->meta, this->lastMode, this->smallDelay); + if (this->store && this->store->GetValid() && this->entries.size() > 0) StoreUtils::DownloadHandle(this->store, this->entries[this->store->GetEntry()], this->dwnldList, this->storeMode, this->meta, this->lastMode, this->smallDelay); break; case 2: diff --git a/source/store/markMenu.cpp b/source/store/markMenu.cpp index 43691b7..d44c3ed 100644 --- a/source/store/markMenu.cpp +++ b/source/store/markMenu.cpp @@ -88,7 +88,7 @@ void StoreUtils::MarkHandle(std::unique_ptr &entry, const std::uniqu touchPosition t; hidTouchRead(&t); - if (meta && entry) { + if (meta && entry && store) { if (hidKeysDown() & KEY_TOUCH) { /* Star. */ if (touching(t, markBox[0])) {