diff --git a/src/Tgstation.Server.Host/Controllers/ApiController.cs b/src/Tgstation.Server.Host/Controllers/ApiController.cs index 8a86e895b7..9739363db3 100644 --- a/src/Tgstation.Server.Host/Controllers/ApiController.cs +++ b/src/Tgstation.Server.Host/Controllers/ApiController.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -341,11 +341,11 @@ namespace Tgstation.Server.Host.Controllers } ICollection finalResults; - if (typeof(TModel) == typeof(TResultModel)) - finalResults = (List)(object)pagedResults; // clearly a safe cast + if (typeof(TResultModel).IsAssignableFrom(typeof(TModel))) + finalResults = pagedResults.Cast().ToList(); // clearly a safe cast else finalResults = pagedResults - .OfType>() + .Cast>() .Select(x => x.ToApi()) .ToList();