Browse files

Fixed where I defer.

  • Loading branch information...
1 parent 1a6ce33 commit 02020a852e44b9b215b9daddccb3ace6518279af @phf committed Dec 5, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 db.go
View
4 db.go
@@ -278,12 +278,12 @@ type PythonicCursor interface {
func ExecuteDirectly(connection Connection, query string, parameters ...) (results [][]interface{}, error os.Error) {
var s Statement;
s, error = connection.Prepare(query);
- if error != nil { return }
defer s.Close();
+ if error != nil { return }
var c Cursor;
c, error = connection.Execute(s, parameters);
- if error != nil { return }
+ if error != nil || c == nil { return }
defer c.Close();
results, error = c.FetchAll();

0 comments on commit 02020a8

Please sign in to comment.