From 06086d92da9d0952faff48e085a21804f9c780ed Mon Sep 17 00:00:00 2001 From: Pk11 Date: Fri, 26 Mar 2021 06:13:02 -0500 Subject: [PATCH] Derp fix Most of these weren't needed, and it definitely doesn't need to check <= 0 on an unsigned int, but a couple of these do need !empty() checks --- source/menu/downList.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/menu/downList.cpp b/source/menu/downList.cpp index 6bead34..a55dfeb 100644 --- a/source/menu/downList.cpp +++ b/source/menu/downList.cpp @@ -175,7 +175,7 @@ void StoreUtils::DownloadHandle(const std::unique_ptr &entry, const smallDelay--; } - if ((hDown & KEY_Y) || (hDown & KEY_START) || (hDown & KEY_TOUCH && touching(touch, downloadBoxes[6]))) { + if ((hDown & (KEY_Y | KEY_START) || (hDown & KEY_TOUCH && touching(touch, downloadBoxes[6]))) && !entries.empty()) { if (is3DSX) { // Only allow if 3DSX. if (StoreUtils::entries.size() <= 0) return; // Smaller than 0 -> No No. @@ -233,13 +233,13 @@ void StoreUtils::DownloadHandle(const std::unique_ptr &entry, const } } - if (smallDelay == 0 && hDown & KEY_A) { + if (smallDelay == 0 && hDown & KEY_A && !entries.empty()) { if (Msg::promptMsg(Lang::get("EXECUTE_ENTRY") + "\n\n" + entries[StoreUtils::store->GetDownloadIndex()])) { StoreUtils::AddToQueue(entry->GetEntryIndex(), entries[StoreUtils::store->GetDownloadIndex()], entry->GetTitle(), entry->GetLastUpdated()); } } - if (hDown & KEY_X) { + if (hDown & KEY_X && !entries.empty()) { if (installs[StoreUtils::store->GetDownloadIndex()]) { StoreUtils::meta->RemoveInstalled(StoreUtils::store->GetUniStoreTitle(), entry->GetTitle(), entries[StoreUtils::store->GetDownloadIndex()]); installs[StoreUtils::store->GetDownloadIndex()] = false;