Browse Source

Prevent panic on empty HOST for mysql (#11850) (#11856)

Backport #11850

Signed-off-by: Andrew Thornton <art27@cantab.net>
tags/v1.12.0
zeripath 3 years ago
parent
commit
6b1e5f7f88
No account linked to committer's email address
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      modules/setting/database.go

+ 1
- 1
modules/setting/database.go View File

@@ -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

Loading…
Cancel
Save