Skip to content

Commit

Permalink
Merge pull request #3215 from stefan0xC/fix-post-emergency-access
Browse files Browse the repository at this point in the history
don't nullify key when editing emergency access
  • Loading branch information
dani-garcia authored Feb 12, 2023
2 parents 8c1117f + c58aac5 commit 53fa8da
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/api/core/emergency_access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ async fn post_emergency_access(

emergency_access.atype = new_type;
emergency_access.wait_time_days = data.WaitTimeDays;
emergency_access.key_encrypted = data.KeyEncrypted;
if data.KeyEncrypted.is_some() {
emergency_access.key_encrypted = data.KeyEncrypted;
}

emergency_access.save(&mut conn).await?;
Ok(Json(emergency_access.to_json()))
Expand Down

0 comments on commit 53fa8da

Please sign in to comment.