From 87b66d0816e1ad2d145ea87279461c02aaf49094 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Thu, 10 Oct 2019 18:06:28 +0200 Subject: Make cmd_account safer --- src/command/cmd_funcs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 9a3d2c93..2c68cd1f 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -1013,8 +1013,12 @@ cmd_account(ProfWin *window, const char *const command, gchar **args) } ProfAccount *account = accounts_get_account(session_get_account_name()); - cons_show_account(account); - account_free(account); + if (account) { + cons_show_account(account); + account_free(account); + } else { + log_error("Could not get accounts"); + } return TRUE; } -- cgit 1.4.1-2-gfad0