From 81293cea063b367fdc2767c9157e0d41e4d495b5 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 16 Nov 2013 18:17:36 +0100 Subject: [PATCH] Avoid empty batch in ListredirectsPage::preprocessResults Change-Id: Iaf371cdb1c0628a42996537d966165a0d7f92ad7 --- includes/specials/SpecialListredirects.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/includes/specials/SpecialListredirects.php b/includes/specials/SpecialListredirects.php index 2c8792ff6f..de05be41f8 100644 --- a/includes/specials/SpecialListredirects.php +++ b/includes/specials/SpecialListredirects.php @@ -76,20 +76,19 @@ class ListredirectsPage extends QueryPage { * @param ResultWrapper $res */ function preprocessResults( $db, $res ) { - $batch = new LinkBatch; + if ( !$res->numRows() ) { + return; + } + $batch = new LinkBatch; foreach ( $res as $row ) { $batch->add( $row->namespace, $row->title ); $batch->addObj( $this->getRedirectTarget( $row ) ); } - $batch->execute(); // Back to start for display - if ( $res->numRows() > 0 ) { - // If there are no rows we get an error seeking. - $db->dataSeek( $res, 0 ); - } + $res->seek( 0 ); } protected function getRedirectTarget( $row ) { -- 2.20.1