Skip to content

Commit

Permalink
chore: 资源加载不存在的文件夹时报错
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Jan 10, 2025
1 parent fb0d36c commit f80ace7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/MaaFramework/Resource/ResourceMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,12 +508,16 @@ bool ResourceMgr::load(const std::filesystem::path& path)
{
LogFunc << VAR(path);

using namespace path_literals;
if (!std::filesystem::exists(path) || !std::filesystem::is_directory(path)) {
LogError << "path not exists or not a directory" << VAR(path);
return false;
}

check_and_set_inference_device();

paths_.emplace_back(path);

using namespace path_literals;
bool ret = default_pipeline_.load(path / "default_pipeline.json"_path);
ret &= pipeline_res_.load(path / "pipeline"_path, false, default_pipeline_);
ret &= ocr_res_.lazy_load(path / "model"_path / "ocr"_path, false);
Expand Down

0 comments on commit f80ace7

Please sign in to comment.