diff --git a/lib/winrm/shells/base.rb b/lib/winrm/shells/base.rb index cf2ff5d4..7bb86637 100644 --- a/lib/winrm/shells/base.rb +++ b/lib/winrm/shells/base.rb @@ -147,6 +147,7 @@ def reset_on_error(error) end def cleanup_command(command_id) + return unless shell_id logger.debug("[WinRM] cleaning up command_id: #{command_id} on shell_id #{shell_id}") cleanup_msg = WinRM::WSMV::CleanupCommand.new( connection_opts,