Skip to content

Commit

Permalink
Prevent panic on empty HOST for mysql (#11850)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Thornton <[email protected]>
  • Loading branch information
zeripath committed Jun 11, 2020
1 parent a3fe9d8 commit 9ecf732
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/setting/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func DBConnStr() (string, error) {
switch Database.Type {
case "mysql":
connType := "tcp"
if Database.Host[0] == '/' { // looks like a unix socket
if len(Database.Host) > 0 && Database.Host[0] == '/' { // looks like a unix socket
connType = "unix"
}
tls := Database.SSLMode
Expand Down

0 comments on commit 9ecf732

Please sign in to comment.