!60 BugFix loop maybe nullprt when start worker loop

Merge pull request !60 from wangzhaoyong/master
This commit is contained in:
openharmony_ci 2022-06-27 13:44:34 +00:00 committed by Gitee
commit 9a105a7f7d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -365,7 +365,11 @@ public:
void Loop()
{
uv_loop_t* loop = GetWorkerLoop();
uv_run(loop, UV_RUN_DEFAULT);
if (loop != nullptr) {
uv_run(loop, UV_RUN_DEFAULT);
} else {
HILOG_ERROR("worker:: Worker loop is nullptr when start worker loop");
}
}
private: