Check the return value properly

[MAILPOET-2535]
This commit is contained in:
Pavel Dohnal
2019-11-19 10:21:51 +01:00
committed by Jack Kitterhing
parent 3a9a98b842
commit 52b81478fb

View File

@@ -85,7 +85,7 @@ class ImportExport extends APIEndpoint {
$task = ScheduledTask::where('type', WooCommerceSync::TASK_TYPE)
->whereRaw('status = ? OR status IS NULL', [ScheduledTask::STATUS_SCHEDULED])
->findOne();
if ($task && $task->status === null) {
if (($task instanceof ScheduledTask) && $task->status === null) {
return $this->successResponse();
}
if (!$task) {