You're leaving the result set open if `rset != nil && db.hadError`. As you can send messages to `nil` without a problem, I suggest using the `@try {...} @finally {...}` pattern here, as used elsewhere.