ShokoAnime / ShokoServer

Repository for Shoko Server.
http://shokoanime.com/shoko-server/
MIT License
376 stars 74 forks source link

Null reference exception when anidb group is unknown #1073

Closed funniray closed 12 months ago

funniray commented 12 months ago

VERSION INFORMATION

Server Version: Daily (f369b32) Desktop Version: 4.2.1

LOG FILE

[2023-07-24 16:23:55:312] Info|AsyncMethodBuilderCore.Start => <InvokeAsync>d__10.MoveNext => <>c__DisplayClass10_0.<InvokeAsync>g__CaptureException|4 Event '00000000000000000000000000000000' queued.
[2023-07-24 16:23:55:312] Error|AsyncMethodBuilderCore.Start => <ProcessRequests>d__226`1.MoveNext => HttpProtocol.ReportApplicationError Connection id "0HMSC0LGS7Q6A", Request id "0HMSC0LGS7Q6A:00000002": An unhandled exception was thrown by the application.: System.InvalidOperationException: Failed to compare two elements in the array.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Shoko.Server.FileQualityFilter.CompareVersionTo(SVR_VideoLocal newFile, SVR_VideoLocal oldFile) in D:\a\ShokoServer\ShokoServer\Shoko.Server\Import\FileQualityFilter.cs:line 614
   at Shoko.Server.FileQualityFilter.CompareTo(SVR_VideoLocal newFile, SVR_VideoLocal oldFile) in D:\a\ShokoServer\ShokoServer\Shoko.Server\Import\FileQualityFilter.cs:line 434
   at System.Collections.Generic.ArraySortHelper`1.InsertionSort(Span`1 keys, Comparison`1 comparer)
   at System.Collections.Generic.ArraySortHelper`1.IntroSort(Span`1 keys, Int32 depthLimit, Comparison`1 comparer)
   at System.Collections.Generic.ArraySortHelper`1.IntroSort(Span`1 keys, Int32 depthLimit, Comparison`1 comparer)
   at System.Collections.Generic.ArraySortHelper`1.Sort(Span`1 keys, Comparison`1 comparer)
   --- End of inner exception stack trace ---
   at System.Collections.Generic.ArraySortHelper`1.Sort(Span`1 keys, Comparison`1 comparer)
   at Shoko.Server.ShokoServiceImplementation.GetGroupVideoQualitySummary(Int32 animeID) in D:\a\ShokoServer\ShokoServer\Shoko.Server\API\v1\Implementations\ShokoServiceImplementation\ShokoServiceImplementation_Utilities.cs:line 1474
   at lambda_method4781(Closure , Object , Object[] )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Shoko.Server.API.APIExtensions.<>c.<<UseAPI>b__4_0>d.MoveNext() in D:\a\ShokoServer\ShokoServer\Shoko.Server\API\APIExtensions.cs:line 239
--- End of stack trace from previous location ---
   at Sentry.AspNetCore.SentryMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Sentry.AspNetCore.SentryMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)

STEPS TO REPRODUCE

da3dsoul commented 12 months ago

https://github.com/ShokoAnime/ShokoServer/commit/fb54df8a0593e41705a4ed4a31df42cc65b69039