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
4848
4949 const lines = stringToLines ( result . stdout ) ;
5050
51- networks = lines . map ( ( line ) => {
51+ for ( const line of lines ) {
5252 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+ }
5560 } catch ( err ) {
5661 console . error ( "Failed to list docker networks:" , err ) ;
5762 }
@@ -97,10 +102,15 @@ export async function getDockerContainerNetworks(): Promise<DockerContainerNetwo
97102
98103 const lines = stringToLines ( result . stdout ) ;
99104
100- containers = lines . map ( ( line ) => {
105+ for ( const line of lines ) {
101106 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+ }
104114 } catch ( err ) {
105115 console . error ( "Failed to list docker containers:" , err ) ;
106116 }
Original file line number Diff line number Diff line change 1313 "skipLibCheck" : true ,
1414 "noEmit" : true ,
1515 "strict" : true ,
16+ "noUncheckedIndexedAccess" : true ,
1617 "paths" : {
1718 "@trigger.dev/core" : [" ../../packages/core/src/index" ],
1819 "@trigger.dev/core/*" : [" ../../packages/core/src/*" ],
You can’t perform that action at this time.
0 commit comments