Index: trunk/extensions/MWSearch/MWSearch_body.php |
— | — | @@ -30,10 +30,11 @@ |
31 | 31 | static function prefixSearch( $ns, $search, $limit, &$results ) { |
32 | 32 | $it = LuceneSearchSet::newFromQuery( 'prefix', $search, $ns, $limit, 0 ); |
33 | 33 | $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 | + } |
36 | 38 | } |
37 | | - |
38 | 39 | return false; |
39 | 40 | } |
40 | 41 | |