Merge pull request #7110 from vonchenplus/fix_extract_offline_romefs_error

applets/web: Fallback to loader to get the manual romfs if none is found
This commit is contained in:
Morph 2021-10-11 02:09:42 -04:00 committed by GitHub
commit 97452b9558
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,6 +24,7 @@
#include "core/hle/service/am/applets/applet_web_browser.h" #include "core/hle/service/am/applets/applet_web_browser.h"
#include "core/hle/service/filesystem/filesystem.h" #include "core/hle/service/filesystem/filesystem.h"
#include "core/hle/service/ns/pl_u.h" #include "core/hle/service/ns/pl_u.h"
#include "core/loader/loader.h"
namespace Service::AM::Applets { namespace Service::AM::Applets {
@ -122,6 +123,15 @@ FileSys::VirtualFile GetOfflineRomFS(Core::System& system, u64 title_id,
const auto nca = system.GetContentProvider().GetEntry(title_id, nca_type); const auto nca = system.GetContentProvider().GetEntry(title_id, nca_type);
if (nca == nullptr) { if (nca == nullptr) {
if (nca_type == FileSys::ContentRecordType::HtmlDocument) {
LOG_WARNING(Service_AM, "Falling back to AppLoader to get the RomFS.");
FileSys::VirtualFile romfs;
system.GetAppLoader().ReadManualRomFS(romfs);
if (romfs != nullptr) {
return romfs;
}
}
LOG_ERROR(Service_AM, LOG_ERROR(Service_AM,
"NCA of type={} with title_id={:016X} is not found in the ContentProvider!", "NCA of type={} with title_id={:016X} is not found in the ContentProvider!",
nca_type, title_id); nca_type, title_id);