check if $lines is empty
authorAaron Schulz <aaron@users.mediawiki.org>
Sun, 17 Aug 2008 00:57:31 +0000 (00:57 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sun, 17 Aug 2008 00:57:31 +0000 (00:57 +0000)
includes/specials/SpecialAllpages.php

index 13a6ab0..8e4eb00 100644 (file)
@@ -188,7 +188,11 @@ function showToplevel( $namespace = NS_MAIN, $from = '', $to = '', $including =
        // If there are only two or less sections, don't even display them.
        // Instead, display the first section directly.
        if( count( $lines ) <= 2 ) {
-               $this->showChunk( $namespace, $lines[0], $lines[count($lines)-1], $including );
+               if( !empty($lines) ) {
+                       $this->showChunk( $namespace, $lines[0], $lines[count($lines)-1], $including );
+               } else {
+                       $wgOut->addHtml( $this->namespaceForm( $namespace, $from, $to ) );
+               }
                return;
        }