1
0
forked from liza/Deliveroo

[F] Fix null safety in GetItemIdFromItemName (#3)

Reviewed-on: liza/Deliveroo#3
This commit is contained in:
Liza 2024-08-29 06:46:52 +00:00
commit 1b54ba9c41

View File

@ -23,5 +23,6 @@ internal sealed class ItemCache
}
}
public HashSet<uint> GetItemIdFromItemName(string name) => _itemNamesToIds[name];
public HashSet<uint> GetItemIdFromItemName(string name) =>
_itemNamesToIds.TryGetValue(name, out var itemIds) ? itemIds : [];
}