Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when started chat #23

Open
raymand211092 opened this issue Jan 24, 2024 · 1 comment
Open

Error when started chat #23

raymand211092 opened this issue Jan 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@raymand211092
Copy link

raymand211092 commented Jan 24, 2024

{"level":"debug","user_id":"@RayManD:mx.grupotd.nat.cu","action":"start chat","method":"ids lookup","cache_result":{"tel:+5352526475":{"has_cache":true,"cache_time":"2024-01-23T15:30:48.538-05:00","identity_count":0,"will_lookup":false}},"server_lookup":null,"time":"2024-01-23T15:34:23.478367351-05:00","message":"Got lookup results from cache"}
{"level":"error","event_id":"$BuPGNfrjIfD1EPurfHwN9apz3aZ5T6-ZXZEugRVeV_A","room_id":"!EdfKVCUpniCoSkGqjk:mx.grupotd.nat.cu","sender":"@RayManD:mx.grupotd.nat.cu","mx_command":"start-chat","stack":"goroutine 215 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x5e\nmaunium.net/go/mautrix/bridge/commands.(*Processor).Handle.func1()\n\t/builds/mautrix/imessagego/.cache/pkg/mod/maunium.net/go/[email protected]/bridge/commands/processor.go:67 +0x5f\npanic({0xe8a840?, 0x17e4a50?})\n\t/usr/local/go/src/runtime/panic.go:914 +0x21f\nmain.(*User).startChat(0xc000586000, {{0xc0000744d0?, 0x7f4265e78e78?, 0x7f4265e6d108?}})\n\t/builds/mautrix/imessagego/user.go:596 +0x32f\nmain.fnStartChat(0xc0000745a0)\n\t/builds/mautrix/imessagego/commands.go:204 +0x50\nmain.init.wrapCommand.func4(0xc000586380)\n\t/builds/mautrix/imessagego/commands.go:43 +0xec\nmaunium.net/go/mautrix/bridge/commands.(*FullHandler).Run(0x17f4f20, 0xc000586380)\n\t/builds/mautrix/imessagego/.cache/pkg/mod/maunium.net/go/[email protected]/bridge/commands/handler.go:98 +0xfb\nmaunium.net/go/mautrix/bridge/commands.(*Processor).Handle(0xc00015ef20, {0x1270698, 0xc000708e40}, {0xc0005be480, 0x25}, {0xc0005be450, 0x2c}, {0x1273c58?, 0xc000586000}, {0xc000464c78, ...}, ...)\n\t/builds/mautrix/imessagego/.cache/pkg/mod/maunium.net/go/[email protected]/bridge/commands/processor.go:121 +0x99e\ncreated by maunium.net/go/mautrix/bridge.(*MatrixHandler).HandleMessage in goroutine 214\n\t/builds/mautrix/imessagego/.cache/pkg/mod/maunium.net/go/[email protected]/bridge/matrix.go:579 +0xa0c\n","error":"invalid memory address or nil pointer dereference","time":"2024-01-23T15:34:23.482065389-05:00","message":"Panic in Matrix command handler"}

imagen

@raymand211092 raymand211092 added the bug Something isn't working label Jan 24, 2024
@rishabhRsinghvi
Copy link

The error one's encountering is caused by a "nil pointer dereference" in the startChat function. This means that the code is trying to access or use a part of memory that hasn't been allocated or initialized, leading to a runtime panic.

In simpler terms, somewhere in the startChat function or its related code, there is an attempt to use a variable or a pointer that is nil (i.e., it doesn't point to any valid data). This could be due to various reasons, such as an uninitialized variable, a failed assignment, or a function that returns nil under certain conditions without proper handling.

To fix this, one would need to:

  1. Identify the Nil Pointer: Locate the variable or pointer that is nil and causing the error.
  2. Add Checks: Ensure that the variable or pointer is not nil before using it. Add conditional checks to handle nil cases appropriately.
  3. Initialize Properly: Make sure all necessary variables and pointers are properly initialized before use.

By addressing these points, one may prevent the "nil pointer dereference" error and ensure the function runs smoothly.

@raymand211092 what are your views?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants