aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/FileSystem/Content/ContentManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.HLE/FileSystem/Content/ContentManager.cs')
-rw-r--r--Ryujinx.HLE/FileSystem/Content/ContentManager.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/Ryujinx.HLE/FileSystem/Content/ContentManager.cs b/Ryujinx.HLE/FileSystem/Content/ContentManager.cs
index 4c4f3c86..1630835d 100644
--- a/Ryujinx.HLE/FileSystem/Content/ContentManager.cs
+++ b/Ryujinx.HLE/FileSystem/Content/ContentManager.cs
@@ -653,6 +653,15 @@ namespace Ryujinx.HLE.FileSystem.Content
public SystemVersion VerifyFirmwarePackage(string firmwarePackage)
{
+ _virtualFileSystem.Reload();
+
+ // LibHac.NcaHeader's DecryptHeader doesn't check if HeaderKey is empty and throws InvalidDataException instead
+ // So, we check it early for a better user experience.
+ if (_virtualFileSystem.KeySet.HeaderKey.IsEmpty())
+ {
+ throw new MissingKeyException("HeaderKey is empty. Cannot decrypt NCA headers.");
+ }
+
Dictionary<ulong, List<(NcaContentType type, string path)>> updateNcas = new Dictionary<ulong, List<(NcaContentType, string)>>();
if (Directory.Exists(firmwarePackage))