20after4 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382625 )

Change subject: InterwikiLookup::fetch is documented to return 
Interwiki|null|bool
......................................................................

InterwikiLookup::fetch is documented to return Interwiki|null|bool

This code was only expecting the happy path of an Interwiki object,
but it can also return null or bool. Accept and skip the site
if interwiki can't find it.

Bug: T177535
Change-Id: I5059557d91d9e2106740a91d1fc2614f7146ab31
---
M includes/BaseInterwikiResolver.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/25/382625/1

diff --git a/includes/BaseInterwikiResolver.php 
b/includes/BaseInterwikiResolver.php
index 0cd08d5..3c36cef 100644
--- a/includes/BaseInterwikiResolver.php
+++ b/includes/BaseInterwikiResolver.php
@@ -137,7 +137,7 @@
        private function loadConfigFromAPI( $wikis, array $hashConfigFlags, 
$fallbackConfig ) {
                foreach ( $wikis as $prefix => $wiki ) {
                        $iw = $this->interwikiLookup->fetch( $prefix );
-                       if ( !$this->useConfigDumpApi || !$iw->isLocal() ) {
+                       if ( !$iw || !$this->useConfigDumpApi || 
!$iw->isLocal() ) {
                                continue;
                        }
                        $api = $iw->getAPI();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5059557d91d9e2106740a91d1fc2614f7146ab31
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: wmf/1.31.0-wmf.2
Gerrit-Owner: 20after4 <mmod...@wikimedia.org>
Gerrit-Reviewer: EBernhardson <ebernhard...@wikimedia.org>

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

Reply via email to