MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354907 )

Change subject: Check if makeTitleSafe returns null in getNewsletterUrl()
......................................................................

Check if makeTitleSafe returns null in getNewsletterUrl()

Bug: T159081
Change-Id: I77c595d1e6314f456684e8900d700383bf1ec3ca
---
M includes/Echo/BaseNewsletterPresentationModel.php
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/07/354907/1

diff --git a/includes/Echo/BaseNewsletterPresentationModel.php 
b/includes/Echo/BaseNewsletterPresentationModel.php
index d88c6f5..b0555d6 100644
--- a/includes/Echo/BaseNewsletterPresentationModel.php
+++ b/includes/Echo/BaseNewsletterPresentationModel.php
@@ -15,6 +15,10 @@
        }
 
        protected function getNewsletterUrl() {
-               return Title::makeTitleSafe( NS_NEWSLETTER, 
$this->getNewsletterName() )->getFullURL();
+               $result = Title::makeTitleSafe( NS_NEWSLETTER, 
$this->getNewsletterName() )->getFullURL();
+               if( !$result ) {
+                       throw new MWException( 'Cannot find newsletter with 
name \"' . $this->getNewsletterName() . '\"' );
+               }
+               return $result;
        }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/354907
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I77c595d1e6314f456684e8900d700383bf1ec3ca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: MtDu <justin.d...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to