diff --git a/lib/msf/ui/console/command_dispatcher.rb b/lib/msf/ui/console/command_dispatcher.rb index d23cdffc39..a3ee24f7f7 100644 --- a/lib/msf/ui/console/command_dispatcher.rb +++ b/lib/msf/ui/console/command_dispatcher.rb @@ -88,11 +88,11 @@ module CommandDispatcher if (commands.include?(words[0])) if (self.respond_to?('cmd_'+words[0]+'_tabs')) res = self.send('cmd_'+words[0]+'_tabs', str, words) - return nil if res.nil? + return [] if res.nil? items.concat(res) else # Avoid the default completion list for known commands - return nil + return [] end end diff --git a/lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb b/lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb index fbbbda671c..ab71d685ce 100644 --- a/lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb +++ b/lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb @@ -595,11 +595,11 @@ class Console::CommandDispatcher::Core if (commands.include?(words[0])) if (self.respond_to?('cmd_'+words[0]+'_tabs')) res = self.send('cmd_'+words[0]+'_tabs', str, words) - return nil if res.nil? + return [] if res.nil? items.concat(res) else # Avoid the default completion list for known commands - return nil + return [] end end