diff --git a/comment_notify.module b/comment_notify.module index 55ed9f2..d1ada09 100644 --- a/comment_notify.module +++ b/comment_notify.module @@ -351,7 +351,14 @@ function _comment_notify_mailalert(CommentInterface $comment) { foreach ($author_fields as $author_field) { // Send to a subscribed author if they are not the current commenter. if ($entity->hasField($author_field)) { - $author = $entity->getOwner(); + // If the entity is a user object, then the user object is the "author'. + if ($entity instanceof User) { + $author = $entity; + } + // For now assume every other entity has an "owner". + else { + $author = $entity->getOwner(); + } $author_notify_settings = comment_notify_get_user_notification_setting($author->id()) ?: comment_notify_get_default_notification_setting(); $author_email = $author->getEmail();