File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed
internal-packages/testcontainers Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -48,10 +48,15 @@ export async function getDockerNetworkAttachments(): Promise<DockerNetworkAttach
48
48
49
49
const lines = stringToLines ( result . stdout ) ;
50
50
51
- networks = lines . map ( ( line ) => {
51
+ for ( const line of lines ) {
52
52
const [ id , name ] = lineToWords ( line ) ;
53
- return { id, name } ;
54
- } ) ;
53
+
54
+ if ( ! id || ! name ) {
55
+ continue ;
56
+ }
57
+
58
+ networks . push ( { id, name } ) ;
59
+ }
55
60
} catch ( err ) {
56
61
console . error ( "Failed to list docker networks:" , err ) ;
57
62
}
@@ -97,10 +102,15 @@ export async function getDockerContainerNetworks(): Promise<DockerContainerNetwo
97
102
98
103
const lines = stringToLines ( result . stdout ) ;
99
104
100
- containers = lines . map ( ( line ) => {
105
+ for ( const line of lines ) {
101
106
const [ id , name ] = lineToWords ( line ) ;
102
- return { id, name } ;
103
- } ) ;
107
+
108
+ if ( ! id || ! name ) {
109
+ continue ;
110
+ }
111
+
112
+ containers . push ( { id, name } ) ;
113
+ }
104
114
} catch ( err ) {
105
115
console . error ( "Failed to list docker containers:" , err ) ;
106
116
}
Original file line number Diff line number Diff line change 13
13
"skipLibCheck" : true ,
14
14
"noEmit" : true ,
15
15
"strict" : true ,
16
+ "noUncheckedIndexedAccess" : true ,
16
17
"paths" : {
17
18
"@trigger.dev/core" : [" ../../packages/core/src/index" ],
18
19
"@trigger.dev/core/*" : [" ../../packages/core/src/*" ],
You can’t perform that action at this time.
0 commit comments