Skip to content

Commit

Permalink
Return empty buffer when there is no result
Browse files Browse the repository at this point in the history
  • Loading branch information
Danappelxx committed Nov 2, 2016
1 parent a11464e commit c009b18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/PostgreSQL/Result.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public class Result: SQL.ResultProtocol {

let count = PQgetlength(resultPointer, Int32(rowIndex), Int32(fieldIndex))
guard count > 0, let start = PQgetvalue(resultPointer, Int32(rowIndex), Int32(fieldIndex)) else {
return Buffer()
return nil
}

return start.withMemoryRebound(to: UInt8.self, capacity: Int(count)) { start in
Expand Down

0 comments on commit c009b18

Please sign in to comment.