Handle section-text being null

This was causing warnings in production:
Invalid parameter for message "notification-body-edit-user-talk-with-section": a:1:{s:9:"plaintext";N;}

Change-Id: Ibdea5d899caf446a8c7f811416fdabaa3dccccdd
This commit is contained in:
Roan Kattouw 2016-05-13 16:37:34 -07:00
parent 712109fa5d
commit d2f899d9d3

View file

@ -57,10 +57,11 @@ class EchoEditUserTalkPresentationModel extends EchoEventPresentationModel {
}
public function getBodyMessage() {
if ( !$this->isBundled() && $this->hasSection() ) {
$sectionText = $this->event->getExtraParam( 'section-text' );
if ( !$this->isBundled() && $this->hasSection() && $sectionText !== null ) {
$msg = $this->msg( 'notification-body-edit-user-talk-with-section' );
// section-text is safe to use here, because hasSection() returns false if the revision is deleted
$msg->plaintextParams( $this->event->getExtraParam( 'section-text' ) );
$msg->plaintextParams( $sectionText );
return $msg;
} else {
return false;