File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 17
17
package app
18
18
19
19
import (
20
+ "errors"
20
21
"github.com/devtron-labs/devtron/api/bean"
21
22
"github.com/devtron-labs/devtron/internal/sql/repository/helper"
22
23
"go.uber.org/zap"
@@ -60,12 +61,16 @@ func (impl *AppListingViewBuilderImpl) BuildView(fetchAppListingRequest FetchApp
60
61
61
62
var appContainersResponses []* bean.AppContainer
62
63
for k , v := range filteredAppEnvMap {
63
- appId , err := strconv .Atoi (strings .Split (k , "_" )[0 ])
64
+ appIdAndName := strings .Split (k , "_" )
65
+ if len (appIdAndName ) != 2 {
66
+ return []* bean.AppContainer {}, errors .New ("invalid format for app id and name. It should be in format <appId>_<appName>" )
67
+ }
68
+ appId , err := strconv .Atoi (appIdAndName [0 ])
64
69
if err != nil {
65
70
impl .Logger .Error ("err" , err )
66
71
return []* bean.AppContainer {}, nil
67
72
}
68
- appName := strings . Split ( k , "_" ) [1 ]
73
+ appName := appIdAndName [1 ]
69
74
defaultEnv := bean.AppEnvironmentContainer {}
70
75
projectId := 0
71
76
for _ , env := range v {
You can’t perform that action at this time.
0 commit comments