From 6f1ee382b5e4ec17a9b5cff0478f207f97bf0238 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Fri, 3 Nov 2023 19:07:16 +0100 Subject: [PATCH] Fix regression from 087cfd7a8c5f81c60589be36646cb59802f00fbb on hashset item duplicate re-add --- Source/Engine/Core/Collections/HashSet.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Engine/Core/Collections/HashSet.h b/Source/Engine/Core/Collections/HashSet.h index 166ca5cc3..d3fcf461d 100644 --- a/Source/Engine/Core/Collections/HashSet.h +++ b/Source/Engine/Core/Collections/HashSet.h @@ -702,8 +702,9 @@ private: FindPositionResult pos; FindPosition(key, pos); - // Ensure key is unknown - ASSERT(pos.ObjectIndex == -1 && "That key has been already added to the dictionary."); + // Check if object has been already added + if (pos.ObjectIndex != -1) + return nullptr; // Insert ASSERT(pos.FreeSlotIndex != -1);