Skip to content

Commit e7eece6

Browse files
David MaloneyDavid Maloney
authored andcommitted
add a nil catch to timestamp file sink
an additional nil guard is needed here just to be sure
1 parent 27ba8f0 commit e7eece6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/rex/logging/sinks/timestamp_flatfile.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module Sinks
1212
class TimestampFlatfile < Flatfile
1313

1414
def log(sev, src, level, msg, from) # :nodoc:
15+
return unless msg.present?
1516
msg = msg.chop.gsub(/\x1b\[[0-9;]*[mG]/,'').gsub(/[\x01-\x02]/, " ")
1617
fd.write("[#{get_current_timestamp}] #{msg}\n")
1718
fd.flush

0 commit comments

Comments
 (0)