protected function outputResults( $out, $skin, $dbr, $res, $num, $offset ) {
$prevMediaType = null;
foreach ( $res as $row ) {
- list( $mediaType, $mime, $totalCount, $totalBytes ) = $this->splitFakeTitle( $row->title );
+ $mediaStats = $this->splitFakeTitle( $row->title );
+ if ( count( $mediaStats ) < 4 ) {
+ continue;
+ }
+ list( $mediaType, $mime, $totalCount, $totalBytes ) = $mediaStats;
if ( $prevMediaType !== $mediaType ) {
if ( $prevMediaType !== null ) {
// We're not at beginning, so we have to