diff --git a/Wabbajack.BuildServer/Controllers/IndexedFiles.cs b/Wabbajack.BuildServer/Controllers/IndexedFiles.cs index 1ebf75d0..a82c050e 100644 --- a/Wabbajack.BuildServer/Controllers/IndexedFiles.cs +++ b/Wabbajack.BuildServer/Controllers/IndexedFiles.cs @@ -92,6 +92,8 @@ namespace Wabbajack.BuildServer.Controllers public async Task GetFile(string xxHashAsBase64) { var result = await _sql.AllArchiveContents(BitConverter.ToInt64(xxHashAsBase64.FromHex())); + if (result == null) + return NotFound(); return Ok(result); } diff --git a/Wabbajack.BuildServer/Models/Sql/SqlService.cs b/Wabbajack.BuildServer/Models/Sql/SqlService.cs index a88acbc6..0d2907c9 100644 --- a/Wabbajack.BuildServer/Models/Sql/SqlService.cs +++ b/Wabbajack.BuildServer/Models/Sql/SqlService.cs @@ -130,7 +130,7 @@ namespace Wabbajack.BuildServer.Model.Models } return new List(); } - return Build(0).First(); + return Build(0).FirstOrDefault(); } public async Task IngestAllMetrics(IEnumerable allMetrics)