mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-27 17:51:09 +00:00
TopicSubscriptionsPager: Fix exception when no subscriptions
Bug: T362507 Change-Id: I569fb2ae017edc9d8e49910faff85e8c9301077d
This commit is contained in:
parent
c7595b012b
commit
cf792094bb
|
@ -36,7 +36,7 @@ class TopicSubscriptionsPager extends TablePager {
|
|||
private ThreadItemFormatter $threadItemFormatter;
|
||||
|
||||
/** @var array<string,DatabaseThreadItem[]> */
|
||||
private array $threadItemsByName;
|
||||
private array $threadItemsByName = [];
|
||||
|
||||
public function __construct(
|
||||
IContextSource $context,
|
||||
|
@ -55,6 +55,9 @@ class TopicSubscriptionsPager extends TablePager {
|
|||
* @inheritDoc
|
||||
*/
|
||||
public function preprocessResults( $result ) {
|
||||
if ( !$result->numRows() ) {
|
||||
return;
|
||||
}
|
||||
$lb = $this->linkBatchFactory->newLinkBatch();
|
||||
$itemNames = [];
|
||||
foreach ( $result as $row ) {
|
||||
|
@ -63,7 +66,6 @@ class TopicSubscriptionsPager extends TablePager {
|
|||
}
|
||||
$lb->execute();
|
||||
|
||||
$this->threadItemsByName = [];
|
||||
// Increased limit to allow finding and skipping over some bad permalinks
|
||||
$threadItems = $this->threadItemStore->findNewestRevisionsByName( $itemNames, $this->mLimit * 5 );
|
||||
foreach ( $threadItems as $threadItem ) {
|
||||
|
|
Loading…
Reference in a new issue