Skip to content

Commit

Permalink
Fixed GetPrices Api from trying to order a null value
Browse files Browse the repository at this point in the history
  • Loading branch information
TheKye committed Sep 8, 2024
1 parent 3c31b58 commit 1728d47
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Eco.EM.Framework/API/Requests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public string GetPrices([FromQuery]bool includeOutOfStock = false)
string noResult = "No Items Found";
if (BasePlugin.Obj.Config.EnableWebAPI)
{
var result = ShopUtils.GetAllItems(includeOutOfStock).OrderBy(o => o.StoreName);
var result = ShopUtils.GetAllItems(includeOutOfStock);
if (result is null)
return noResult;
else
Expand Down
3 changes: 3 additions & 0 deletions Eco.EM.Framework/Utils/ShopUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ public static List<OfferedItem> GetAllItems(bool includeOutOfStock = false)
}
}
if (Items.Count > 0)
{
Items.OrderBy(o => o.StoreName);
return Items;
}
else
return null;
}
Expand Down

0 comments on commit 1728d47

Please sign in to comment.