Check for null before calling a textResults method to (fixes T165091)
authorMukunda Modell <mmodell@wikimedia.org>
Thu, 11 May 2017 19:59:12 +0000 (14:59 -0500)
committerMukunda Modell <mmodell@wikimedia.org>
Thu, 11 May 2017 19:59:12 +0000 (14:59 -0500)
Bug: T165091
Change-Id: I6fd23eb5fa04049fd7a44faae76f77fae23f5202

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">' );