ChartWindow: Small fixes

This commit is contained in:
2024-01-23 00:37:18 +01:00
parent 24a43ff37d
commit 37658869e4
3 changed files with 9 additions and 20 deletions

View File

@ -367,7 +367,7 @@ namespace Elwig.Helpers.Billing {
}
if (qualityWei.Count == 1) {
data["quality"] = new JsonObject() {
["WEI"] = qualityWei.Single().Value
["WEI"] = qualityWei.Single().Value?.DeepClone()
};
} else if (qualityWei.Count > 1) {
data["quality"] = new JsonObject() {

View File

@ -42,7 +42,7 @@ namespace Elwig.Helpers.Billing {
dict2[idx].Add("default");
}
var virtOffset = dict1.Max(e => e.Key) + 1;
var virtOffset = dict1.Count > 0 ? dict1.Max(e => e.Key) + 1 : 1;
Dictionary<int, Curve> curves = GetCurves();
decimal[] virtCurves = [.. dict2.Keys.Order()];
for (int i = 0; i < virtCurves.Length; i++) {