diff --git a/lib/rex/logging/sinks/timestamp_flatfile.rb b/lib/rex/logging/sinks/timestamp_flatfile.rb index bb8fe132b8..b7fa229922 100644 --- a/lib/rex/logging/sinks/timestamp_flatfile.rb +++ b/lib/rex/logging/sinks/timestamp_flatfile.rb @@ -12,6 +12,7 @@ module Sinks class TimestampFlatfile < Flatfile def log(sev, src, level, msg, from) # :nodoc: + return unless msg.present? msg = msg.chop.gsub(/\x1b\[[0-9;]*[mG]/,'').gsub(/[\x01-\x02]/, " ") fd.write("[#{get_current_timestamp}] #{msg}\n") fd.flush diff --git a/lib/rex/ui/text/shell.rb b/lib/rex/ui/text/shell.rb index 7446a87a0d..4c9cc27d2a 100644 --- a/lib/rex/ui/text/shell.rb +++ b/lib/rex/ui/text/shell.rb @@ -272,6 +272,7 @@ module Shell # def print_error(msg='') return if (output.nil?) + return if (msg.nil?) self.on_print_proc.call(msg) if self.on_print_proc # Errors are not subject to disabled output