From 25ad5ca62cf5def8a457ae0c22069ddd4aae7d52 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Sun, 23 Jul 2023 21:51:42 +0100 Subject: [PATCH] fix: what happens when the key does not exist --- src/methods/account_update.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/methods/account_update.rs b/src/methods/account_update.rs index 977e625..8733210 100644 --- a/src/methods/account_update.rs +++ b/src/methods/account_update.rs @@ -42,7 +42,7 @@ pub async fn post_update_ldap(mut req: Request) -> tide::Result { pw_keep_same = true; pw_secure = true; } - if !tmp.attrs["skSecure"].is_empty() && tmp.attrs["skSecure"][0] == "1" { + if tmp.attrs.contains_key("skSecure") && !tmp.attrs["skSecure"].is_empty() && tmp.attrs["skSecure"][0] == "1" { pw_secure = true; } }