nminaya / grammar-nazi-bot

Bot that corrects spelling mistakes.
MIT License
31 stars 8 forks source link

Application Exception: Index was outside the bounds of the array. #46

Closed nminaya closed 3 years ago

nminaya commented 3 years ago

This is an issue created automatically by GrammarNazi when an exception was captured.

Date (UTC): 12/19/2020 14:10:27

Exception:

System.IndexOutOfRangeException: Index was outside the bounds of the array. at System.Array.Clear(Array array, Int32 index, Int32 length) at GrammarNazi.Core.Services.BaseGrammarService.SetWhiteListWords(IEnumerable`1 whiteListWords) in /src/GrammarNazi.Core/Services/GrammarServices/BaseGrammarService.cs:line 28 at GrammarNazi.App.HostedServices.TelegramBotHostedService.GetConfiguredGrammarService(ChatConfiguration chatConfig) in /src/GrammarNazi.App/HostedServices/TelegramBotHostedService.cs:line 149 at GrammarNazi.App.HostedServices.TelegramBotHostedService.OnMessageReceived(Object sender, MessageEventArgs messageEvent) in /src/GrammarNazi.App/HostedServices/TelegramBotHostedService.cs:line 98 at GrammarNazi.App.HostedServices.TelegramBotHostedService.b__8_0(Object obj, MessageEventArgs eventArgs) in /src/GrammarNazi.App/HostedServices/TelegramBotHostedService.cs:line 72

nminaya commented 3 years ago

This System.IndexOutOfRangeException was thrown on this line: https://github.com/nminaya/grammar-nazi-bot/blob/c42c0ab9f3b6daba5ab270298a58e158bd7f929d/GrammarNazi.Core/Services/GrammarServices/BaseGrammarService.cs#L28

Currently I don't see a way to reproduce this. It could be something related to concurrency, or maybe a bug with List class.