Avoid an undefined variable when generating the toolbar for directories