feat: CustomTask增加任务存在检测

This commit is contained in:
status102
2025-09-14 21:45:04 +08:00
parent 27b847ba71
commit d1df9b2578

View File

@@ -1,7 +1,8 @@
#include "CustomTask.h"
#include "Config/TaskData.h"
#include "Task/Miscellaneous/ScreenshotTaskPlugin.h"
#include "Task/ProcessTask.h"
#include "Utils/Logger.hpp"
asst::CustomTask::CustomTask(const AsstCallback& callback, Assistant* inst) :
@@ -28,6 +29,10 @@ bool asst::CustomTask::set_params(const json::value& params)
Log.error("set_params failed, task is not string");
return false;
}
if (Task.get(t.as_string()) == nullptr) {
Log.error("set_params failed, task not found: ", t.as_string());
return false;
}
tasks.emplace_back(t.as_string());
}
m_custom_task_ptr->set_tasks(std::move(tasks));