From a9c921a41dec63f76f80df1f0d5dc3be40fa80de Mon Sep 17 00:00:00 2001
From: Zach Hilman <zachhilman@gmail.com>
Date: Sun, 29 Jul 2018 20:47:33 -0400
Subject: Use ErrorEncrypted where applicable and fix no keys crash

---
 src/core/loader/xci.cpp | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'src/core/loader/xci.cpp')

diff --git a/src/core/loader/xci.cpp b/src/core/loader/xci.cpp
index b4de5bd169..74940fb831 100644
--- a/src/core/loader/xci.cpp
+++ b/src/core/loader/xci.cpp
@@ -48,6 +48,10 @@ ResultStatus AppLoader_XCI::Load(Kernel::SharedPtr<Kernel::Process>& process) {
         return ResultStatus::ErrorAlreadyLoaded;
     }
 
+    if (xci->GetNCAFileByType(FileSys::NCAContentType::Program) == nullptr) {
+        return ResultStatus::ErrorEncrypted;
+    }
+
     auto result = nca_loader->Load(process);
     if (result != ResultStatus::Success)
         return result;
-- 
cgit v1.2.3-70-g09d2