mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 03:25:11 +01:00 
			
		
		
		
	Prevent panic on empty HOST for mysql (#11850)
Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
		
							parent
							
								
									a3fe9d87f2
								
							
						
					
					
						commit
						9ecf732abc
					
				| @ -105,7 +105,7 @@ func DBConnStr() (string, error) { | |||||||
| 	switch Database.Type { | 	switch Database.Type { | ||||||
| 	case "mysql": | 	case "mysql": | ||||||
| 		connType := "tcp" | 		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" | 			connType = "unix" | ||||||
| 		} | 		} | ||||||
| 		tls := Database.SSLMode | 		tls := Database.SSLMode | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user