stablekernel / postgresql-dart

Dart PostgreSQL driver: supports extended query format, binary protocol and statement reuse.
https://www.dartdocs.org/documentation/postgres/latest
BSD 3-Clause "New" or "Revised" License
127 stars 32 forks source link

Fix startup packet length when username is null #111

Closed leonardoce closed 5 years ago

leonardoce commented 5 years ago

username is an optional parameter in the connection open method but the startup packet length was calculated as the username was always not null. This patch fix that behavior, leading to a more clear (backend raised) error message when you don't pass the username field on network connections.