lib/google/cloud/trace/utils.rb in google-cloud-trace-0.27.0 vs lib/google/cloud/trace/utils.rb in google-cloud-trace-0.27.1
- old
+ new
@@ -26,9 +26,10 @@
# Convert a Ruby Time object to a timestamp proto object.
#
# @private
#
def self.time_to_grpc time
+ return nil if time.nil?
Google::Protobuf::Timestamp.new seconds: time.to_i,
nanos: time.nsec
end
##