Describe the bug
Message locale can be null. Some users has null locale. In that case default locale shall be used.
Exception example:
Caused by: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null
at java.base/sun.util.locale.LocaleUtils.toLowerString(Unknown Source)
at java.base/sun.util.locale.LanguageTag.parse(Unknown Source)
at java.base/java.util.Locale.forLanguageTag(Unknown Source)
at ru.dankoy.telegrambot.core.service.localeprovider.LocaleProviderImpl.getLocale(LocaleProviderImpl.java:17)
at ru.dankoy.telegrambot.core.service.bot.commands.CommandsExtractorServiceImpl.getCommand(CommandsExtractorServiceImpl.java:31)
at ru.dankoy.telegrambot.core.service.flow.BotCommandValidatorImpl.isValid(BotCommandValidatorImpl.java:29)
Expected behavior
Class BotCOmmandValidator shall check locale on null, if true, get default locale. Or should it be implemented in LocaleProvider?
Describe the bug Message locale can be null. Some users has null locale. In that case default locale shall be used.
Exception example:
Expected behavior Class BotCOmmandValidator shall check locale on null, if true, get default locale. Or should it be implemented in LocaleProvider?