fix: what happens when the key does not exist

This commit is contained in:
silver 2023-07-23 21:51:42 +01:00
parent f73a7dfa29
commit 25ad5ca62c

View file

@ -42,7 +42,7 @@ pub async fn post_update_ldap(mut req: Request<State>) -> tide::Result {
pw_keep_same = true; pw_keep_same = true;
pw_secure = 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; pw_secure = true;
} }
} }