Skip to content

Commit

Permalink
Fix: prevent infinite loop due when entering invalid commands due to …
Browse files Browse the repository at this point in the history
…the name suggestions system
  • Loading branch information
jorgemanrubia committed Sep 24, 2023
1 parent 35cd842 commit 055751c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/console1984/command_executor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,16 @@ def run_command(run_by_user, &block)
end

def encrypting_error(error)
def error.inspect
Console1984.command_executor.execute_in_protected_mode { super }
if error.respond_to?(:inspect)
def error.inspect
Console1984.command_executor.execute_in_protected_mode { method(:inspect).super_method.call }
end
end

def error.to_s
Console1984.command_executor.execute_in_protected_mode { super }
if error.respond_to?(:to_s)
def error.to_s
Console1984.command_executor.execute_in_protected_mode { method(:to_s).super_method.call }
end
end

error
Expand Down

0 comments on commit 055751c

Please sign in to comment.