From 62d772eaedbdd983574d2bfd0022fff58b55ca73 Mon Sep 17 00:00:00 2001
From: Zach Hilman <zachhilman@gmail.com>
Date: Wed, 10 Apr 2019 12:29:15 -0400
Subject: [PATCH] patch_manager: Add short-circuit edge-case to
 GetPatchVersionNames

If title ID is 0, there are no add ons, prevents wasting time looking for them.
---
 src/core/file_sys/patch_manager.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp
index 0a4f0ea748..e3ebaca03c 100644
--- a/src/core/file_sys/patch_manager.cpp
+++ b/src/core/file_sys/patch_manager.cpp
@@ -408,6 +408,8 @@ static bool IsDirValidAndNonEmpty(const VirtualDir& dir) {
 
 std::map<std::string, std::string, std::less<>> PatchManager::GetPatchVersionNames(
     VirtualFile update_raw) const {
+    if (title_id == 0)
+        return {};
     std::map<std::string, std::string, std::less<>> out;
     const auto& installed = Core::System::GetInstance().GetContentProvider();
     const auto& disabled = Settings::values.disabled_addons[title_id];