[*] cascade errors here plox

This commit is contained in:
Reece Wilson 2023-05-02 11:27:06 +01:00
parent fca5b90b85
commit 75ad160559

View File

@ -68,6 +68,12 @@ namespace Aurora::Async
{ {
for (auto &workItem : workItems) for (auto &workItem : workItems)
{ {
if (!workItem)
{
SysPushErrorArg();
return false;
}
auto dependency = AuReinterpretCast<WorkItem>(workItem); auto dependency = AuReinterpretCast<WorkItem>(workItem);
AU_LOCK_GUARD(dependency->lock); AU_LOCK_GUARD(dependency->lock);
@ -111,6 +117,11 @@ namespace Aurora::Async
AuSPtr<IWorkItem> WorkItem::Then(const AuSPtr<IWorkItem> &next) AuSPtr<IWorkItem> WorkItem::Then(const AuSPtr<IWorkItem> &next)
{ {
auto that = AU_SHARED_FROM_THIS; auto that = AU_SHARED_FROM_THIS;
if (!next)
{
SysPushErrorArg();
return {};
}
next->WaitFor(that); next->WaitFor(that);
next->Dispatch(); next->Dispatch();
return that; return that;