about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2019-10-10 18:06:28 +0200
committerMichael Vetter <jubalh@iodoru.org>2019-10-10 18:06:28 +0200
commit87b66d0816e1ad2d145ea87279461c02aaf49094 (patch)
tree4533cc7f10eabcaa3cb6a862892cf9c6fd49764c /src/command
parentd3dd95963e354c3e75f4a6e627acb3644c679fbf (diff)
downloadprofani-tty-87b66d0816e1ad2d145ea87279461c02aaf49094.tar.gz
Make cmd_account safer
Diffstat (limited to 'src/command')
-rw-r--r--src/command/cmd_funcs.c8
1 files changed, 6 insertions, 2 deletions
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;
 }