Browse Source
Prevent panic on empty HOST for mysql (#11850)
Signed-off-by: Andrew Thornton <art27@cantab.net>
for-closed-social
zeripath
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
modules/setting/database.go
|
|
@ -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 |
|
|
|