Skip to content

Commit

Permalink
Correcting error when comments are not pulled.
Browse files Browse the repository at this point in the history
  • Loading branch information
thundrax committed Dec 10, 2021
1 parent a91d777 commit 78074d4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugins/RoleTitle/class.roletitle.plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 86,10 @@ public function discussionController_render_before($sender, $args) {
if (property_exists($sender, 'Discussion')) {
$joinDiscussion = [$sender->Discussion];
RoleModel::setUserRoles($joinDiscussion, 'InsertUserID');
$comments = $sender->data('Comments');
RoleModel::setUserRoles($comments->result(), 'InsertUserID');

$comments = $sender->data('Comments', null);
if ($comments != null) {
RoleModel::setUserRoles($comments->result(), 'InsertUserID');
}
$answers = $sender->data('Answers');
if (is_array($answers)) {
RoleModel::setUserRoles($answers, 'InsertUserID');
Expand Down

0 comments on commit 78074d4

Please sign in to comment.