lib/oboe/xtrace.rb in oboe-2.5.0.7 vs lib/oboe/xtrace.rb in oboe-2.6.0.2
- old
+ new
@@ -10,9 +10,12 @@
#
# Perform basic validation on a potential X-Trace ID
#
def valid?(xtrace)
begin
+ # Shouldn't be nil
+ return false unless xtrace
+
# The X-Trace ID shouldn't be an initialized empty ID
return false if (xtrace =~ /^1b0000000/i) == 0
# Valid X-Trace IDs have a length of 58 bytes and start with '1b'
return false unless xtrace.length == 58 and (xtrace =~ /^1b/i) == 0