diff --git a/exam/classes/Models/Post/Post.php b/exam/classes/Models/Post/Post.php index f44a196..daf6be7 100644 --- a/exam/classes/Models/Post/Post.php +++ b/exam/classes/Models/Post/Post.php @@ -141,7 +141,7 @@ class Post implements JsonSerializable } else $reason = ["{$e->getCode()}"]; } } - if ($failed !== null) { + if (count($failed) > 0) { $db->rollBack(); throw ApiError::failedUpdate($failed, $reason);