summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-03-23 11:38:43 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-03-23 11:38:43 +0000
commitdc9c06f32b99badc355bd9d68550db9775fe798b (patch)
tree3d056ae011668aadd883ba64b86feab9f2811a7f
parentPort synapse_port_db to async/await (#6718) (diff)
parentAvoid attribute error when `password_config` present but empty (#6753) (diff)
downloadsynapse-dc9c06f32b99badc355bd9d68550db9775fe798b.tar.xz
Avoid attribute error when `password_config` present but empty (#6753)
* commit '837f62266':
  Avoid attribute error when `password_config` present but empty (#6753)
-rw-r--r--changelog.d/6753.bugfix1
-rwxr-xr-xscripts/hash_password2
2 files changed, 2 insertions, 1 deletions
diff --git a/changelog.d/6753.bugfix b/changelog.d/6753.bugfix
new file mode 100644

index 0000000000..5dfde793e1 --- /dev/null +++ b/changelog.d/6753.bugfix
@@ -0,0 +1 @@ +Fix `AttributeError: 'NoneType' object has no attribute 'get'` in `hash_password` when configuration has an empty `password_config`. Contributed by @ivilata. diff --git a/scripts/hash_password b/scripts/hash_password
index a1eb0769da..a30767f758 100755 --- a/scripts/hash_password +++ b/scripts/hash_password
@@ -52,7 +52,7 @@ if __name__ == "__main__": if "config" in args and args.config: config = yaml.safe_load(args.config) bcrypt_rounds = config.get("bcrypt_rounds", bcrypt_rounds) - password_config = config.get("password_config", {}) + password_config = config.get("password_config", None) or {} password_pepper = password_config.get("pepper", password_pepper) password = args.password