changeset 1931:2c55e7e99ef3

core (memory/params): fixed exception when setting an empty password
author Goffi <goffi@goffi.org>
date Sat, 26 Mar 2016 18:43:54 +0100
parents 70ce9421c4d3
children 44342730df66
files src/memory/params.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/memory/params.py	Sat Mar 26 16:15:23 2016 +0100
+++ b/src/memory/params.py	Sat Mar 26 18:43:54 2016 +0100
@@ -879,6 +879,8 @@
                 d.addCallback(lambda dummy: PasswordHasher.hash(value))  # profile password is hashed (empty value stays empty)
             elif value:  # other non empty passwords are encrypted with the personal key
                 d = BlockCipher.encrypt(personal_key, value)
+            else:
+                d = defer.succeed(value)
         else:
             d = defer.succeed(value)