Skip to content

Commit 1728d47

Browse files
committed
Fixed GetPrices Api from trying to order a null value
1 parent 3c31b58 commit 1728d47

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Eco.EM.Framework/API/Requests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public string GetPrices([FromQuery]bool includeOutOfStock = false)
4242
string noResult = "No Items Found";
4343
if (BasePlugin.Obj.Config.EnableWebAPI)
4444
{
45-
var result = ShopUtils.GetAllItems(includeOutOfStock).OrderBy(o => o.StoreName);
45+
var result = ShopUtils.GetAllItems(includeOutOfStock);
4646
if (result is null)
4747
return noResult;
4848
else

Eco.EM.Framework/Utils/ShopUtils.cs

+3
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,10 @@ public static List<OfferedItem> GetAllItems(bool includeOutOfStock = false)
197197
}
198198
}
199199
if (Items.Count > 0)
200+
{
201+
Items.OrderBy(o => o.StoreName);
200202
return Items;
203+
}
201204
else
202205
return null;
203206
}

0 commit comments

Comments
 (0)