Skip to content

Commit

Permalink
feat: 跳过 $ 开头的键
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Oct 15, 2023
1 parent 916e39d commit 9d96b08
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions source/MaaFramework/Resource/PipelineResMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,22 @@ bool PipelineResMgr::parse_config(const json::value& input, TaskDataMap& output,
TaskDataMap data_map;

for (const auto& [key, value] : input.as_object()) {
if (key.empty()) {
LogError << "key is empty" << VAR(key);
return false;
}
if (key.starts_with('$')) {
LogInfo << "key starts with '$', skip" << VAR(key);
continue;
}
if (existing_keys.contains(key)) {
LogError << "key already exists" << VAR(key);
return false;
}
if (!value.is_object()) {
LogError << "value is not object" << VAR(key) << VAR(value);
return false;
}

TaskData task_data;
const auto& default_task_data = default_value.contains(key) ? default_value.at(key) : TaskData {};
Expand Down

0 comments on commit 9d96b08

Please sign in to comment.