Browse files

Fix rare issue in the postgres adapter

I've only seen this happen once, where the ensure block raised an
exception because q was false.  This check should at least do no
harm.
  • Loading branch information...
1 parent 99beb68 commit f2b1372a11687bf8b6d26b2c2c8180e2b76d72fa @jeremyevans committed Jul 17, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/sequel/adapters/postgres.rb
View
2 lib/sequel/adapters/postgres.rb
@@ -187,7 +187,7 @@ def execute(sql, args=nil)
begin
block_given? ? yield(q) : q.cmd_tuples
ensure
- q.clear
+ q.clear if q
end
end

0 comments on commit f2b1372

Please sign in to comment.