File tree 1 file changed +8
-5
lines changed
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -68,11 +68,14 @@ func (h *HelperStore) GetAll() (map[string]types.AuthConfig, error) {
68
68
return nil , err
69
69
}
70
70
71
- possiblePortNumber := strings .Split (ctx , ":" )[len (strings .Split (ctx , ":" ))- 1 ]
72
- if regexp .MustCompile (`\d+$` ).MatchString (possiblePortNumber ) {
73
- // port number confirmed
74
- toolName = toolName + ":" + possiblePortNumber
75
- ctx = strings .TrimSuffix (ctx , ":" + possiblePortNumber )
71
+ contextPieces := strings .Split (ctx , ":" )
72
+ if len (contextPieces ) > 1 {
73
+ possiblePortNumber := contextPieces [len (contextPieces )- 1 ]
74
+ if regexp .MustCompile (`\d+$` ).MatchString (possiblePortNumber ) {
75
+ // port number confirmed
76
+ toolName = toolName + ":" + possiblePortNumber
77
+ ctx = strings .TrimSuffix (ctx , ":" + possiblePortNumber )
78
+ }
76
79
}
77
80
78
81
newCredAddresses [toolNameWithCtx (toolName , ctx )] = val
You can’t perform that action at this time.
0 commit comments