if ( is_object( $backendName ) || isset( $this->backends[$backendName] ) ) is supposed to make sure an $autoBackends entry is only created, but it assumes the non-auto backends have been registered already. Should be something like if ( is_object( $backendName ) || isset( $this->backends[$backendName] ) || isset( $wgFileBackends[$backendName] ) ).