From d602ac4b46af08913e0dcaf8a6098a858905635a Mon Sep 17 00:00:00 2001 From: davegermiquet Date: Thu, 2 Jun 2016 17:56:54 -0400 Subject: [PATCH] ADD IF CONDITION In case connection was lost, or something happens to write terminal to be null --- cowrie/core/honeypot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cowrie/core/honeypot.py b/cowrie/core/honeypot.py index 66bba5b..6e25722 100644 --- a/cowrie/core/honeypot.py +++ b/cowrie/core/honeypot.py @@ -484,7 +484,9 @@ class StdOutStdErrEmulationProtocol(object): """ self.data = self.data + data if not self.next_protocol: - self.protocol.terminal.write(data) + if not self.protocol is None and not self.protocol.terminal is None: + log.msg("Connection was probably lost. Could not write to terminal") + self.protocol.terminal.write(data) def errReceived(self, data):