From 5d66d9410f7f975959d1199d9879ef26341a6ae2 Mon Sep 17 00:00:00 2001 From: Kristaps Kaupe Date: Thu, 20 Dec 2018 21:08:43 +0200 Subject: [PATCH] Check for empty password and cancellation in JoinMarket-Qt wallet generation --- scripts/joinmarket-qt.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/joinmarket-qt.py b/scripts/joinmarket-qt.py index cb11241..47710e4 100644 --- a/scripts/joinmarket-qt.py +++ b/scripts/joinmarket-qt.py @@ -1464,13 +1464,21 @@ class JMMainWindow(QMainWindow): def getPassword(self): pd = PasswordDialog() while True: - pd.exec_() - if pd.new_pw.text() != pd.conf_pw.text(): + pd_return = pd.exec_() + if pd_return == QDialog.Rejected: + return None + elif pd.new_pw.text() != pd.conf_pw.text(): JMQtMessageBox(self, "Passwords don't match.", mbtype='warn', title="Error") continue + elif pd.new_pw.text() == "": + JMQtMessageBox(self, + "Password must not be empty.", + mbtype='warn', + title="Error") + continue break self.textpassword = str(pd.new_pw.text()) return self.textpassword.encode('utf-8')