fix internal server error on 2.9 quests

also fix error on invalid SetAvatar call
This commit is contained in:
Robert Paciorek 2024-02-06 20:20:35 +00:00
parent c39b4bb015
commit 56c388b1d6

View File

@ -194,6 +194,12 @@ public class ContentController : Controller {
CommonInventoryRequest[] request = XmlUtil.DeserializeXml<CommonInventoryRequest[]>(commonInventoryRequestXml); CommonInventoryRequest[] request = XmlUtil.DeserializeXml<CommonInventoryRequest[]>(commonInventoryRequestXml);
List<CommonInventoryResponseItem> responseItems = new(); List<CommonInventoryResponseItem> responseItems = new();
if (request is null) {
return Ok(new CommonInventoryResponse {
Success = false
});
}
// SetCommonInventory can remove any number of items from the inventory, this checks if it's possible // SetCommonInventory can remove any number of items from the inventory, this checks if it's possible
foreach (var req in request) { foreach (var req in request) {
if (req.Quantity >= 0) continue; if (req.Quantity >= 0) continue;
@ -320,6 +326,7 @@ public class ContentController : Controller {
// do not allow override newer version avatar data by older version // do not allow override newer version avatar data by older version
return Ok(new SetAvatarResult { return Ok(new SetAvatarResult {
Success = false, Success = false,
StatusCode = AvatarValidationResult.Error
}); });
} }
} }