From d1820e4dbd7ec54da18e6b32bad0aa90d1027783 Mon Sep 17 00:00:00 2001 From: Jonny Hyman Date: Fri, 21 May 2021 11:39:06 -0700 Subject: [PATCH] some crash handling --- rmc/rmc_server.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rmc/rmc_server.py b/rmc/rmc_server.py index 0da1e8f..37432bd 100644 --- a/rmc/rmc_server.py +++ b/rmc/rmc_server.py @@ -347,8 +347,10 @@ def new_user(self, user=None): self.update_userview() # Restart authentication server (send new userlist) - self.toggle_auth(False) - self.toggle_auth(True) + # if running: + if hasattr(self,'tcp_proc'): + self.toggle_auth(False) + self.toggle_auth(True) def toggle_auth(self, state): """ Toggle authentication server """ @@ -580,6 +582,10 @@ def database_delete(self): """ Delete a postgres database permanently """ ui_db = self.dbses.selected() + + if not ui_db: + return + db_name = ui_db.db_details['name'] quit_msg = f"Are you sure you want to delete database {db_name}?"