Skip to content

Nil Pointer Panic on reconnect - Not handling onConnect being nil #7355

@jvisker

Description

@jvisker

Branch/Environment/Version

  • Branch/Version: Master (and earlier)
  • Environment: Presumably any tyk-gateway, but definitely on-prem

Describe the bug
The recover loop takes a parameter that can later cause a nil pointer exception

Reproduction steps
Steps to reproduce the behavior:

go rc.recoverLoop(ctx, onConnect)
pass through onConnect
onReconnect()

Proposed Solution
Default to a no-op function instead of trying to invoke a function that is nil

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions