Merge "Avoid warnings for empty file sha1 keys"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 26 Jun 2014 20:17:26 +0000 (20:17 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 26 Jun 2014 20:17:26 +0000 (20:17 +0000)
maintenance/deleteArchivedFiles.inc

index 33da666..0c0b34a 100644 (file)
@@ -39,6 +39,10 @@ class DeleteArchivedFilesImplementation {
                $count = 0;
                foreach ( $res as $row ) {
                        $key = $row->fa_storage_key;
+                       if ( !strlen( $key ) ) {
+                               $output->handleOutput( "Entry with ID {$row->fa_id} has empty key, skipping\n" );
+                               continue;
+                       }
                        $group = $row->fa_storage_group;
                        $id = $row->fa_id;
                        $path = $repo->getZonePath( 'deleted' ) . '/' . $repo->getDeletedHashPath( $key ) . $key;