Skip to content

HubEmulator Groups.RemoveFromAllGroupsAsync generating null pointer error #2194

Description

@rikschuiling

Describe the bug

When a connection is in zero groups and the Groups.RemoveFromAllGroupsAsync method gets called there will be thrown a null pointer exception. See the exception below.

To Reproduce

Simply call the method after a connection is made.

Exceptions (if any)

fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HNC087N6J696", Request id "0HNC087N6J696:00000001": An unhandled exception was thrown by the application.
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Azure.SignalR.Emulator.HubEmulator.ManyToManyMap2.RemoveLeft(TLeft left) in D:\a\_work\1\s\src\Microsoft.Azure.SignalR.Emulator\HubEmulator\ManyToManyMap.cs:line 91 at Microsoft.Azure.SignalR.Emulator.HubEmulator.GroupManager.RemoveConnectionFromAllGroups(String connectionId) in D:\a\_work\1\s\src\Microsoft.Azure.SignalR.Emulator\HubEmulator\GroupManager.cs:line 39 at Microsoft.Azure.SignalR.Emulator.Controllers.SignalRServiceEmulatorWebApi.RemoveConnectionFromAllGroups(String hub, String connectionId, String application) in D:\a\_work\1\s\src\Microsoft.Azure.SignalR.Emulator\Controllers\SignalRServiceEmulatorWebApi.cs:line 230 at lambda_method3(Closure, Object, Object[]) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(ActionContext actionContext, 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.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication1 application)

Further technical details

  • Using the latest version of SignalR emulator

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions