lib/sequel/adapters/tinytds.rb in sequel-5.48.0 vs lib/sequel/adapters/tinytds.rb in sequel-5.49.0
- old
+ new
@@ -73,10 +73,10 @@
log_connection_yield(sql, c) do
r = c.execute(sql)
return r.public_send(m) if m
end
end
- yield(r) if block_given?
+ yield(r) if defined?(yield)
rescue TinyTds::Error => e
raise_error(e, :disconnect=>!c.active?)
ensure
r.cancel if r && c.sqlsent? && c.active?
end