From fe799f30c8352876dfba72260b5d60a04ca05bec Mon Sep 17 00:00:00 2001 From: Alex Ling Date: Wed, 3 Jun 2020 08:19:40 +0000 Subject: [PATCH] Make the user listing command handles empty DB --- src/mango.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mango.cr b/src/mango.cr index 19934c4..e2d3d00 100644 --- a/src/mango.cr +++ b/src/mango.cr @@ -77,7 +77,7 @@ class CLI < Clim password.not_nil!, opts.admin when "list" users = storage.list_users - name_length = users.map(&.[0].size).max + name_length = users.map(&.[0].size).max? || 0 l_cell_width = ["username".size, name_length].max r_cell_width = "admin access".size header = " #{"username".ljust l_cell_width} | admin access "