summaryrefslogtreecommitdiff
path: root/internal/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/server.go')
-rw-r--r--internal/server.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/server.go b/internal/server.go
index e3fbfb2..f2b3485 100644
--- a/internal/server.go
+++ b/internal/server.go
@@ -130,7 +130,7 @@ func (s *Server) propagateClose() {
// JoinDefaultPort appends ":<port>" iff the address does not already contain a port.
func JoinDefaultPort(address string, port string) string {
- if address[0] == '[' {
+ if len(address) > 0 && address[0] == '[' {
hend := strings.LastIndexByte(address, ']')
if len(address) > hend+1 && address[hend+1] == ':' {
return address