File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 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) {
6868 return nil , err
6969 }
7070
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+ }
7679 }
7780
7881 newCredAddresses [toolNameWithCtx (toolName , ctx )] = val
You can’t perform that action at this time.
0 commit comments