From 9894685f28550fa13f5b81fbd746fbca03b9e513 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Mon, 30 Apr 2018 14:24:42 +0200 Subject: [PATCH] Prevent profiles with GUID.Empty as ID --- Vocaluxe/Base/CProfiles.cs | 2 +- Vocaluxe/Base/Server/CWebservice.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Vocaluxe/Base/CProfiles.cs b/Vocaluxe/Base/CProfiles.cs index 12440e5f..04354a5f 100644 --- a/Vocaluxe/Base/CProfiles.cs +++ b/Vocaluxe/Base/CProfiles.cs @@ -357,7 +357,7 @@ namespace Vocaluxe.Base public static bool IsProfileIDValid(Guid profileID) { - return _Profiles.ContainsKey(profileID); + return profileID != Guid.Empty && _Profiles.ContainsKey(profileID); } public static bool IsAvatarIDValid(int avatarID) diff --git a/Vocaluxe/Base/Server/CWebservice.cs b/Vocaluxe/Base/Server/CWebservice.cs index e44606a1..e2315c80 100644 --- a/Vocaluxe/Base/Server/CWebservice.cs +++ b/Vocaluxe/Base/Server/CWebservice.cs @@ -90,7 +90,7 @@ namespace Vocaluxe.Base.Server { Guid sessionKey = _GetSession(); - if (profile.ProfileId != Guid.Empty) //-1 is the id for a new profile + if (profile.ProfileId != Guid.Empty) //Guid.Empty is the id for a new profile { if (CSessionControl.GetUserIdFromSession(sessionKey) != profile.ProfileId && !(_CheckRight(EUserRights.EditAllProfiles)))