mirror of
https://github.com/moodle/moodle.git
synced 2025-01-29 11:46:19 +01:00
MDL-64588 core_comment: fix unnecessary type check in add_comments
We should rely on the return type, else an exception with be thrown.
This commit is contained in:
parent
93ea6612bd
commit
0c3eaf9ee6
@ -254,10 +254,8 @@ class core_comment_external extends external_api {
|
||||
foreach ($params['comments'] as $comment) {
|
||||
$manager = $comment['preparedcomment'];
|
||||
$newcomment = $manager->add($comment['content']);
|
||||
if (!empty($newcomment) && is_object($newcomment)) {
|
||||
$results[] = $newcomment;
|
||||
}
|
||||
$newcomment->delete = true; // USER created the comment, so they can delete it.
|
||||
$results[] = $newcomment;
|
||||
}
|
||||
|
||||
return $results;
|
||||
|
Loading…
x
Reference in New Issue
Block a user