Merge pull request #456 from wabbajack-tools/404-on-no-archive

Return a 404 (instead of an exception) when an archive isn't indexed
This commit is contained in:
Timothy Baldridge 2020-01-30 17:01:11 -07:00 committed by GitHub
commit 3a0e4c39cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -92,6 +92,8 @@ namespace Wabbajack.BuildServer.Controllers
public async Task<IActionResult> GetFile(string xxHashAsBase64)
{
var result = await _sql.AllArchiveContents(BitConverter.ToInt64(xxHashAsBase64.FromHex()));
if (result == null)
return NotFound();
return Ok(result);
}

View File

@ -130,7 +130,7 @@ namespace Wabbajack.BuildServer.Model.Models
}
return new List<IndexedVirtualFile>();
}
return Build(0).First();
return Build(0).FirstOrDefault();
}
public async Task IngestAllMetrics(IEnumerable<Metric> allMetrics)