Merge "Check for null before calling a textResults method to (fixes T165091)"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 11 May 2017 21:36:06 +0000 (21:36 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 11 May 2017 21:36:06 +0000 (21:36 +0000)
includes/specials/SpecialSearch.php

index ceb6b7b..2a5016f 100644 (file)
@@ -356,7 +356,7 @@ class SpecialSearch extends SpecialPage {
                $hasOtherResults = $textMatches &&
                        $textMatches->hasInterwikiResults( SearchResultSet::INLINE_RESULTS );
 
-               if ( $textMatches->hasInterwikiResults( SearchResultSet::SECONDARY_RESULTS ) ) {
+               if ( $textMatches && $textMatches->hasInterwikiResults( SearchResultSet::SECONDARY_RESULTS ) ) {
                        $out->addHTML( '<div class="searchresults mw-searchresults-has-iw">' );
                } else {
                        $out->addHTML( '<div class="searchresults">' );