Check if all resources exist before publishing a level

This commit is contained in:
jvyden 2022-03-22 18:20:16 -04:00
commit 626fffa5e0
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278

View file

@ -86,6 +86,11 @@ public class PublishController : ControllerBase
Slot? slot = await this.getSlotFromBody();
if (slot?.Location == null) return this.BadRequest();
foreach (string resource in slot.Resources)
{
if (!FileHelper.ResourceExists(resource)) return this.BadRequest();
}
// Republish logic
if (slot.SlotId != 0)
{