mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
wpiutil: uv::Work: Don't connect work and afterWork if they're null
This commit is contained in:
@@ -39,8 +39,8 @@ void QueueWork(Loop& loop, const std::shared_ptr<WorkReq>& req) {
|
||||
void QueueWork(Loop& loop, std::function<void()> work,
|
||||
std::function<void()> afterWork) {
|
||||
auto req = std::make_shared<WorkReq>();
|
||||
req->work.connect(work);
|
||||
req->afterWork.connect(afterWork);
|
||||
if (work) req->work.connect(work);
|
||||
if (afterWork) req->afterWork.connect(afterWork);
|
||||
QueueWork(loop, req);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user