File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -14,10 +14,10 @@ public sealed class HelpCommandHandler : IRequestHandler<HelpCommand>
1414
1515 public HelpCommandHandler (
1616 ILogger < HelpCommandHandler > logger ,
17- IOptions < ApplicationSettings > _options )
17+ IOptions < ApplicationSettings > options )
1818 {
1919 _logger = logger ;
20- _commandPrefix = _options . Value . CommandPrefix ;
20+ _commandPrefix = options . Value . CommandPrefix ;
2121 }
2222
2323 public async Task Handle ( HelpCommand request , CancellationToken cancellationToken )
Original file line number Diff line number Diff line change @@ -13,9 +13,9 @@ public static class CommandsExtensions
1313 return null ;
1414 }
1515
16- var command = message . Content . Substring ( 1 ) . Split ( ' ' ) [ 0 ] ;
16+ var command = message . Content . Substring ( 1 ) . Split ( ' ' ) . FirstOrDefault ( ) ;
1717
18- if ( ! CommandMapping . Commands . ContainsKey ( command ) )
18+ if ( command is null || ! CommandMapping . Commands . ContainsKey ( command ) )
1919 {
2020 return null ;
2121 }
You can’t perform that action at this time.
0 commit comments