DCausse has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/265782

Change subject: Fix Call to a member function getNamespace() on a non-object
......................................................................

Fix Call to a member function getNamespace() on a non-object

Not sure to understand in which case it happens but it happens.

bug: T124431
Change-Id: I820d67c9dcd1c74e636d83b013a982cb9dfe6e52
---
M includes/CirrusSearch.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/includes/CirrusSearch.php b/includes/CirrusSearch.php
index 3fa038a..5eca4d6 100644
--- a/includes/CirrusSearch.php
+++ b/includes/CirrusSearch.php
@@ -394,9 +394,9 @@
                // We append a random letter behind just in case the search
                // string ends with ':'.
                $title = Title::newFromText( $search . "A" );
-               if ( $title->getNamespace() != NS_MAIN
+               if ( ( $title && $title->getNamespace() != NS_MAIN )
                                || count( $this->namespaces ) != 1
-                               || reset( $this->namespaces ) != NS_MAIN ) {
+                               || reset( $this->namespaces ) != NS_MAIN ) ) ) {
                        // Fallback to prefix search if we are not on content 
namespace
                        return $this->searchSuggestionsPrefixSearchFallback( 
$search );
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I820d67c9dcd1c74e636d83b013a982cb9dfe6e52
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: DCausse <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to