add code to setup missing objects
This commit is contained in:
@@ -62,8 +62,18 @@ public class TraderPurchasePersisterService(
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!profile.TraderPurchases.TryGetValue(traderId, out var _))
|
||||
{
|
||||
profile.TraderPurchases.TryAdd(traderId, new Dictionary<string, TraderPurchaseData>());
|
||||
}
|
||||
|
||||
var traderPurchases = profile.TraderPurchases[traderId];
|
||||
|
||||
if (!traderPurchases.TryGetValue(assortId, out var _))
|
||||
{
|
||||
traderPurchases.TryAdd(assortId, new TraderPurchaseData());
|
||||
}
|
||||
|
||||
return traderPurchases[assortId];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user