Brian Wolff has submitted this change and it was merged. (
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, 11 insertions(+), 1 deletion(-)
Approvals:
Brian Wolff: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/Echo/BaseNewsletterPresentationModel.php
b/includes/Echo/BaseNewsletterPresentationModel.php
index d88c6f5..192e2c7 100644
--- a/includes/Echo/BaseNewsletterPresentationModel.php
+++ b/includes/Echo/BaseNewsletterPresentationModel.php
@@ -15,6 +15,16 @@
}
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: merged
Gerrit-Change-Id: I77c595d1e6314f456684e8900d700383bf1ec3ca
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: MtDu <[email protected]>
Gerrit-Reviewer: 01tonythomas <[email protected]>
Gerrit-Reviewer: Brian Wolff <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits