MentionInSummaryPresentationModel: Fix PHP error

RevisionRecord::getComment() can return null. When it does, accessing
->text on it fails.

Bug: T226681
Change-Id: I069cd5d5bef51a3e2b8f4e7b50d478cf47f65e00
This commit is contained in:
Roan Kattouw 2019-07-15 17:06:15 -07:00
parent c2a61e22fc
commit e6e7541531

View file

@ -22,7 +22,7 @@ class EchoMentionInSummaryPresentationModel extends EchoEventPresentationModel {
public function getBodyMessage() {
$revision = $this->event->getRevision();
if ( $revision && $this->userCan( RevisionRecord::DELETED_COMMENT ) ) {
if ( $revision && $revision->getComment() && $this->userCan( RevisionRecord::DELETED_COMMENT ) ) {
$summary = $revision->getComment()->text;
$summary = Linker::formatComment( $summary );
$summary = Sanitizer::stripAllTags( $summary );