Skip to content

Commit e6ccfbf

Browse files
author
Sebastian Schöps
committed
Don't throw error if no instance in history
1 parent 10d2362 commit e6ccfbf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Models/ProcessInstance.php

+6
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ public function deleteProcessInstances($processInstanceIds, $deleteReason = 'non
7272

7373
public function ended()
7474
{
75+
$processInstance = $this->get('history/process-instance/?processInstanceId=' . $this->id);
76+
77+
if(count($processInstance) == 0) {
78+
return true;
79+
}
80+
7581
return $this->get('history/process-instance/?processInstanceId=' . $this->id)[0]->state == 'COMPLETED';
7682
}
7783

0 commit comments

Comments
 (0)