From d5d22475317731e6dba71c240bdf517995773f5e Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Wed, 28 Aug 2024 17:59:14 -0400 Subject: [PATCH] [F] Fix null safety in GetItemIdFromItemName --- Deliveroo/GameData/ItemCache.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Deliveroo/GameData/ItemCache.cs b/Deliveroo/GameData/ItemCache.cs index a2158c0..4a9fcdb 100644 --- a/Deliveroo/GameData/ItemCache.cs +++ b/Deliveroo/GameData/ItemCache.cs @@ -23,5 +23,6 @@ internal sealed class ItemCache } } - public HashSet GetItemIdFromItemName(string name) => _itemNamesToIds[name]; + public HashSet GetItemIdFromItemName(string name) => + _itemNamesToIds.TryGetValue(name, out var itemIds) ? itemIds : []; }