diff options
-rw-r--r-- | src/Ryujinx.UI.Common/App/ApplicationLibrary.cs | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/src/Ryujinx.UI.Common/App/ApplicationLibrary.cs b/src/Ryujinx.UI.Common/App/ApplicationLibrary.cs index ef3826cfa..2baf06087 100644 --- a/src/Ryujinx.UI.Common/App/ApplicationLibrary.cs +++ b/src/Ryujinx.UI.Common/App/ApplicationLibrary.cs | |||
@@ -175,22 +175,22 @@ namespace Ryujinx.UI.App.Common | |||
175 | var applications = new List<ApplicationData>(); | 175 | var applications = new List<ApplicationData>(); |
176 | string extension = Path.GetExtension(filePath).ToLower(); | 176 | string extension = Path.GetExtension(filePath).ToLower(); |
177 | 177 | ||
178 | foreach ((ulong titleId, ContentMetaData content) in pfs.GetContentData(ContentMetaType.Application, _virtualFileSystem, _checkLevel)) | 178 | try |
179 | { | 179 | { |
180 | ApplicationData applicationData = new() | 180 | foreach ((ulong titleId, ContentMetaData content) in pfs.GetContentData(ContentMetaType.Application, _virtualFileSystem, _checkLevel)) |
181 | { | 181 | { |
182 | Id = titleId, | 182 | ApplicationData applicationData = new() |
183 | Path = filePath, | 183 | { |
184 | }; | 184 | Id = titleId, |
185 | Path = filePath, | ||
186 | }; | ||
185 | 187 | ||
186 | try | ||
187 | { | ||
188 | Nca mainNca = content.GetNcaByType(_virtualFileSystem.KeySet, ContentType.Program); | 188 | Nca mainNca = content.GetNcaByType(_virtualFileSystem.KeySet, ContentType.Program); |
189 | Nca controlNca = content.GetNcaByType(_virtualFileSystem.KeySet, ContentType.Control); | 189 | Nca controlNca = content.GetNcaByType(_virtualFileSystem.KeySet, ContentType.Control); |
190 | 190 | ||
191 | BlitStruct<ApplicationControlProperty> controlHolder = new(1); | 191 | BlitStruct<ApplicationControlProperty> controlHolder = new(1); |
192 | 192 | ||
193 | IFileSystem controlFs = controlNca?.OpenFileSystem(NcaSectionType.Data, IntegrityCheckLevel.None); | 193 | IFileSystem controlFs = controlNca?.OpenFileSystem(NcaSectionType.Data, _checkLevel); |
194 | 194 | ||
195 | // Check if there is an update available. | 195 | // Check if there is an update available. |
196 | if (IsUpdateApplied(mainNca, out IFileSystem updatedControlFs)) | 196 | if (IsUpdateApplied(mainNca, out IFileSystem updatedControlFs)) |
@@ -199,6 +199,11 @@ namespace Ryujinx.UI.App.Common | |||
199 | controlFs = updatedControlFs; | 199 | controlFs = updatedControlFs; |
200 | } | 200 | } |
201 | 201 | ||
202 | if (controlFs == null) | ||
203 | { | ||
204 | continue; | ||
205 | } | ||
206 | |||
202 | ReadControlData(controlFs, controlHolder.ByteSpan); | 207 | ReadControlData(controlFs, controlHolder.ByteSpan); |
203 | 208 | ||
204 | GetApplicationInformation(ref controlHolder.Value, ref applicationData); | 209 | GetApplicationInformation(ref controlHolder.Value, ref applicationData); |
@@ -246,22 +251,18 @@ namespace Ryujinx.UI.App.Common | |||
246 | 251 | ||
247 | applications.Add(applicationData); | 252 | applications.Add(applicationData); |
248 | } | 253 | } |
249 | catch (MissingKeyException exception) | 254 | } |
250 | { | 255 | catch (MissingKeyException exception) |
251 | applicationData.Icon = extension == ".xci" ? _xciIcon : _nspIcon; | 256 | { |
252 | 257 | Logger.Warning?.Print(LogClass.Application, $"Your key set is missing a key with the name: {exception.Name}"); | |
253 | Logger.Warning?.Print(LogClass.Application, $"Your key set is missing a key with the name: {exception.Name}"); | 258 | } |
254 | } | 259 | catch (InvalidDataException) |
255 | catch (InvalidDataException) | 260 | { |
256 | { | 261 | Logger.Warning?.Print(LogClass.Application, $"The header key is incorrect or missing and therefore the NCA header content type check has failed. Errored File: {filePath}"); |
257 | applicationData.Icon = extension == ".xci" ? _xciIcon : _nspIcon; | 262 | } |
258 | 263 | catch (Exception exception) | |
259 | Logger.Warning?.Print(LogClass.Application, $"The header key is incorrect or missing and therefore the NCA header content type check has failed. Errored File: {filePath}"); | 264 | { |
260 | } | 265 | Logger.Warning?.Print(LogClass.Application, $"The file encountered was not of a valid type. File: '{filePath}' Error: {exception}"); |
261 | catch (Exception exception) | ||
262 | { | ||
263 | Logger.Warning?.Print(LogClass.Application, $"The file encountered was not of a valid type. File: '{filePath}' Error: {exception}"); | ||
264 | } | ||
265 | } | 266 | } |
266 | 267 | ||
267 | return applications; | 268 | return applications; |