Addshore has uploaded a new change for review. https://gerrit.wikimedia.org/r/284429
Change subject: Fix Call to a getText() on a non-object (null) ...................................................................... Fix Call to a getText() on a non-object (null) Bug: T133000 Change-Id: I3233a8c5a406d40d3e5308169b2c5999dd382e3a --- M includes/SearchHookHandler.php 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticlePlaceholder refs/changes/29/284429/1 diff --git a/includes/SearchHookHandler.php b/includes/SearchHookHandler.php index 3c18000..a306a64 100644 --- a/includes/SearchHookHandler.php +++ b/includes/SearchHookHandler.php @@ -127,8 +127,11 @@ */ private function createResult( TermSearchResult $searchResult, $link ) { $entityId = $searchResult->getEntityId(); - $label = $searchResult->getDisplayLabel()->getText(); - $description = $searchResult->getDisplayDescription()->getText(); + $displayLabel = $searchResult->getDisplayLabel(); + $displayDescription = $searchResult->getDisplayDescription(); + + $label = $displayLabel ? $displayLabel->getText() : ''; + $description = $displayDescription ? $displayDescription->getText() : ''; return '[[' . $link . wfEscapeWikiText( $entityId ) . '|' . wfEscapeWikiText( $label ) .']]: ' . wfEscapeWikiText( $description ); -- To view, visit https://gerrit.wikimedia.org/r/284429 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3233a8c5a406d40d3e5308169b2c5999dd382e3a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ArticlePlaceholder Gerrit-Branch: master Gerrit-Owner: Addshore <addshorew...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits