fix.在因配置错误导致的指针失效时向日志输出信息

This commit is contained in:
zzyyyl
2022-05-04 14:19:03 +08:00
parent a74ceac116
commit e5fce05360
2 changed files with 12 additions and 2 deletions

View File

@@ -98,6 +98,11 @@ bool asst::ProcessTaskImageAnalyzer::analyze()
for (const std::string& task_name : m_tasks_name) {
auto task_ptr = Task.get(task_name);
// 可能有配置错误,导致不存在对应的任务
if (task_ptr == nullptr) {
Log.error("Invalid task", task_name);
continue;
}
switch (task_ptr->algorithm) {
case AlgorithmType::JustReturn: