summaryrefslogtreecommitdiffstats
path: root/lib/private/comments
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/comments')
-rw-r--r--lib/private/comments/comment.php4
-rw-r--r--lib/private/comments/manager.php4
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/comments/comment.php b/lib/private/comments/comment.php
index 1e1514a5872..75964603f9f 100644
--- a/lib/private/comments/comment.php
+++ b/lib/private/comments/comment.php
@@ -284,9 +284,9 @@ class Comment implements IComment {
}
/**
- * returns the timestamp of the most recent child
+ * returns the DateTime of the most recent child, if set, otherwise null
*
- * @return int
+ * @return \DateTime|null
* @since 9.0.0
*/
public function getLatestChildDateTime() {
diff --git a/lib/private/comments/manager.php b/lib/private/comments/manager.php
index 64013a9e11f..64977c48895 100644
--- a/lib/private/comments/manager.php
+++ b/lib/private/comments/manager.php
@@ -58,7 +58,9 @@ class Manager implements ICommentsManager {
$data['parent_id'] = strval($data['parent_id']);
$data['topmost_parent_id'] = strval($data['topmost_parent_id']);
$data['creation_timestamp'] = new \DateTime($data['creation_timestamp']);
- $data['latest_child_timestamp'] = new \DateTime($data['latest_child_timestamp']);
+ if (!is_null($data['latest_child_timestamp'])) {
+ $data['latest_child_timestamp'] = new \DateTime($data['latest_child_timestamp']);
+ }
$data['children_count'] = intval($data['children_count']);
return $data;
}