Skip to content

Panic (nil pointer) in discord.go:860 when confirming Telegram PIN verification with Discord disabled #491

Description

@TheOnlyBibi

Describe the bug

When a user confirms their PIN via the Telegram bot, the /invite/.../telegram/verified/... endpoint returns a 500 and the sign-up page hangs on “loading” indefinitely. Server logs show a panic (nil pointer dereference) originating in discord.go:860, called from api-messages.go:375, even though the verification was done via Telegram, not Discord. Discord integration is disabled in my config.

To Reproduce

  1. Enable Telegram verification on sign-up ([telegram] enabled = true), Discord left disabled ([discord] enabled = false)
  2. Create an invite, open the sign-up page, confirm the PIN via the Telegram bot
  3. Bot confirms success, but the sign-up page keeps loading
  4. Server logs show a 500 and a panic trace

Logs

Aug 31 17:19:15 server jfa-go[1998]: [GIN] GET(/invite/kL2fYZNpmwsFjxFEX6wT7B/telegram/verified/V9-5H-YE) => 200
Aug 31 17:19:17 server jfa-go[1998]: 2026/08/31 17:19:17 [Recovery] 2026/08/31 - 17:19:17 panic recovered:
Aug 31 17:19:17 server jfa-go[1998]: runtime error: invalid memory address or nil pointer dereference
Aug 31 17:19:17 server jfa-go[1998]: /usr/local/go/src/runtime/panic.go:262 (0x480bf8)
Aug 31 17:19:17 server jfa-go[1998]: /usr/local/go/src/runtime/signal_unix.go:925 (0x480bc8)
Aug 31 17:19:17 server jfa-go[1998]: /woodpecker/src/github.com/hrfee/jfa-go/discord.go:860 (0x13dd0ec)
Aug 31 17:19:17 server jfa-go[1998]: /woodpecker/src/github.com/hrfee/jfa-go/api-messages.go:375 (0x13dd0dd)
Aug 31 17:19:17 server jfa-go[1998]: /go/pkg/mod/github.com/gin-gonic/gin@v1.11.0/context.go:192 (0xf4d40d)
Aug 31 17:19:17 server jfa-go[1998]: /go/pkg/mod/github.com/gin-gonic/gin@v1.11.0/recovery.go:92 (0xf5c290)
Aug 31 17:19:17 server jfa-go[1998]: /go/pkg/mod/github.com/gin-gonic/gin@v1.11.0/context.go:192 (0xf4d40d)
Aug 31 17:19:17 server jfa-go[1998]: /go/pkg/mod/github.com/gin-gonic/gin@v1.11.0/logger.go:249 (0xf5b409)
Aug 31 17:19:17 server jfa-go[1998]: /go/pkg/mod/github.com/gin-gonic/gin@v1.11.0/context.go:192 (0xf4d40d)
Aug 31 17:19:17 server jfa-go[1998]: /go/pkg/mod/github.com/gin-gonic/gin@v1.11.0/gin.go:689 (0xf5a46f)
Aug 31 17:19:17 server jfa-go[1998]: /go/pkg/mod/github.com/gin-gonic/gin@v1.11.0/gin.go:643 (0xf59e09)
Aug 31 17:19:17 server jfa-go[1998]: /usr/local/go/src/net/http/server.go:3301 (0x74f00d)
Aug 31 17:19:17 server jfa-go[1998]: /usr/local/go/src/net/http/server.go:2102 (0x72dac4)
Aug 31 17:19:17 server jfa-go[1998]: /usr/local/go/src/runtime/asm_amd64.s:1700 (0x486b00)
Aug 31 17:19:17 server jfa-go[1998]:
Aug 31 17:19:17 server jfa-go[1998]: [GIN] GET(/invite/kL2fYZNpmwsFjxFEX6wT7B/telegram/verified/V9-5H-YE) => 500

Workaround found

Enabling Discord ([discord] enabled = true) with a dummy/invalid bot token avoids the crash — this suggests the post-verification notification code path unconditionally touches the Discord bot session (*dg.Session), which is nil when Discord is disabled.

Platform/Version

Platform : Linux - Ubuntu 26.04.1 LTS
Deployment : apt
Version : 0.6.0

PS: The linked Telegram account without public username are invisible in admin panel. And the panel just show it like no account have been set, propose to link one

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions