maxisoft / ASFFreeGames

Collect free steam games while asf is running
GNU Affero General Public License v3.0
121 stars 2 forks source link

NullReferenceException in PluginContext.get_CancellationToken() on dev branch #42

Closed maxisoft closed 8 months ago

maxisoft commented 8 months ago

Describe the bug When I try to use the FreeGamesCommand on my bot, I get a NullReferenceException in PluginContext.get_CancellationToken(). This prevents me from saving the options and executing the command.

To Reproduce Steps to reproduce the behavior:

  1. Clone the dev branch of https://github.com/maxisoft/ASFFreeGames
  2. Build and run the plugin with ASF
  3. Send a command like Freegames set VERBOSE
  4. See error

Expected behavior I expected the command to save the options and execute without any errors.

Here is a copy of the error log:

2023-10-29 18:25:24|dotnet-2326|ERROR|ASF|OnBotCommand() System.NullReferenceException: Object reference not set to an instance of an object.
   at Maxisoft.ASF.PluginContext.get_CancellationToken()
   at ASFFreeGames.Commands.FreeGamesCommand.SaveOptions()
   at ASFFreeGames.Commands.FreeGamesCommand.HandleSetCommand(Bot bot, String[] args)
   at ASFFreeGames.Commands.FreeGamesCommand.Execute(Bot bot, String message, String[] args, UInt64 steamID, CancellationToken cancellationToken)
   at ASFFreeGames.Commands.CommandDispatcher.Execute(Bot bot, String message, String[] args, UInt64 steamID, CancellationToken cancellationToken)
   at Maxisoft.ASF.ASFFreeGamesPlugin.OnBotCommand(Bot bot, EAccess access, String message, String[] args, UInt64 steamID)
   at ArchiSteamFarm.Core.Utilities.InParallelT
   at ArchiSteamFarm.Plugins.PluginsCore.OnBotCommand(Bot bot, EAccess access, String message, String[] args, UInt64 steamID)

Desktop (please complete the following information):

OS: Windows 10 ASF: 5.4.12.5 Plugin build with 4e9752464c41e50f1f888586d793da889783ac1f