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

NullPointerException and other "not enough arguments" handling issues while using Telegram bot #72

Closed
arskvsh opened this issue Sep 29, 2023 · 2 comments · Fixed by #73
Labels
good first issue Good for newcomers priority: high Issue or PR review should be main goal type: bug Something isn't working

Comments

@arskvsh
Copy link

arskvsh commented Sep 29, 2023

MCAuth 1.7.12, TelegramBotApi 1.0.0, Velocity-3.2.0-SNAPSHOT-265

I refer to the commands with their config names as I have the slash commands renamed. Config attached: telegram-config.yml.txt

Using 'account-control' and 'unlink' (and may be some other?) commands without parameters in the Telegram bot causes NullPointerException in the server console (server doesn't crash though). Seems that it should be handled at least as 'change-pass' one, which neither throws any exceptions nor returning any messages in Telegram when used without parameters.

However, both behaviours seem strange as there are messages that are supposed to be shown in such cases, their translations can be seen in the config (changepass-not-enough-arguments, unlink-not-enough-arguments, etc.). I haven't succeeded getting those messages anyhow.

image

[01:22:53 ERROR]: java.lang.NullPointerException: Cannot invoke "com.bivashy.auth.api.account.Account.getName()" because "account" is null
[01:22:53 ERROR]:       at me.mastercapexd.auth.messenger.commands.AccountCommand.accountMenu(AccountCommand.java:18)

image

@bivashy bivashy added type: bug Something isn't working good first issue Good for newcomers priority: high Issue or PR review should be main goal labels Sep 30, 2023
@bivashy
Copy link
Owner

bivashy commented Sep 30, 2023

Thank you for providing such a thorough issue report. This would be fixed in the next update.

Issue appears to lie within the command library, which interprets certain arguments as "null", resulting in the disregarding of certain messages.

@bivashy bivashy linked a pull request Sep 30, 2023 that will close this issue
@bivashy
Copy link
Owner

bivashy commented Sep 30, 2023

Fix seems to be working
изображение

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers priority: high Issue or PR review should be main goal type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants