From 232b8f9b382d502a6211630c6fa740a9a28210c5 Mon Sep 17 00:00:00 2001 From: venizelou andreas Date: Mon, 22 Jan 2024 18:38:01 +0200 Subject: [PATCH] Clean up --- Protest/Http/Auth.cs | 2 +- Protest/Tools/SmtpProfiles.cs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Protest/Http/Auth.cs b/Protest/Http/Auth.cs index 1789ce84..41fb8ac8 100644 --- a/Protest/Http/Auth.cs +++ b/Protest/Http/Auth.cs @@ -140,7 +140,7 @@ public static string GrandAccess(HttpListenerContext ctx, string username) { #endif Session newSession = new Session() { - access = acl.TryGetValue(username, out AccessControl value) ? value : default!, + access = acl.TryGetValue(username, out AccessControl value) ? value : default(AccessControl)!, ip = ctx.Request.RemoteEndPoint.Address, sessionId = sessionId, loginDate = DateTime.UtcNow.Ticks, diff --git a/Protest/Tools/SmtpProfiles.cs b/Protest/Tools/SmtpProfiles.cs index 69f24c76..30c0176f 100644 --- a/Protest/Tools/SmtpProfiles.cs +++ b/Protest/Tools/SmtpProfiles.cs @@ -72,8 +72,7 @@ public static byte[] Save(HttpListenerContext ctx) { Profile[] newProfiles = JsonSerializer.Deserialize(payload, smtpProfileSerializerOptionsWithPasswords); for (int i = 0; i < newProfiles.Length; i++) { - if (newProfiles[i].guid == default) { - + if (newProfiles[i].guid == default(Guid)) { newProfiles[i].guid = Guid.NewGuid(); }