mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-10-11 08:18:49 -07:00
fix internal server error when ImageData is empty
This commit is contained in:
parent
2a76705c33
commit
648238613e
@ -23,8 +23,8 @@ public class ImageController : Controller {
|
||||
[Route("RawImage/{VikingId}/{ImageType}/{ImageSlot}.jpg")]
|
||||
public IActionResult RawImage(String VikingId, String ImageType, int ImageSlot) {
|
||||
Image? image = ctx.Images.FirstOrDefault(e => e.VikingId == VikingId && e.ImageType == ImageType && e.ImageSlot == ImageSlot);
|
||||
if (image is null) {
|
||||
return null;
|
||||
if (image is null || image.ImageData is null) {
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
byte[] imageBytes = Convert.FromBase64String(image.ImageData);
|
||||
|
Loading…
x
Reference in New Issue
Block a user