r54125 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54124‎ | r54125 | r54126 >
Date:21:07, 31 July 2009
Author:aaron
Status:deferred
Tags:
Comment:
fixed 'Call to a member function next() on a non-object' error
Modified paths:
  • /trunk/extensions/MWSearch/MWSearch_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MWSearch/MWSearch_body.php
@@ -30,10 +30,11 @@
3131 static function prefixSearch( $ns, $search, $limit, &$results ) {
3232 $it = LuceneSearchSet::newFromQuery( 'prefix', $search, $ns, $limit, 0 );
3333 $results = array();
34 - while( $res = $it->next() ) {
35 - $results[] = $res->getTitle()->getPrefixedText();
 34+ if( $it ) { // $it can be null
 35+ while( $res = $it->next() ) {
 36+ $results[] = $res->getTitle()->getPrefixedText();
 37+ }
3638 }
37 -
3839 return false;
3940 }
4041

Follow-up revisions

RevisionCommit summaryAuthorDate
r54496Merge fatal fix from r54125brion22:50, 5 August 2009

Status & tagging log