File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -209,19 +209,20 @@ for item in contents:
209209 print(item, result[0], result[6], result[9])
210210` ;
211211 const result = await this . _repl . runCode ( code ) ;
212-
213212 let contents = [ ] ;
214213 if ( ! result ) {
215214 return contents ;
216215 }
217216 for ( let line of result . split ( "\n" ) ) {
218- let [ name , isDir , fileSize , fileDate ] = line . split ( " " ) ;
219- contents . push ( {
220- path : name ,
221- isDir : isDir == TYPE_DIR ,
222- fileSize : parseInt ( fileSize ) ,
223- fileDate : parseInt ( fileDate ) * 1000 ,
224- } ) ;
217+ if ( line . length > 0 ) {
218+ let [ name , isDir , fileSize , fileDate ] = line . split ( " " ) ;
219+ contents . push ( {
220+ path : name ,
221+ isDir : isDir == TYPE_DIR ,
222+ fileSize : parseInt ( fileSize ) ,
223+ fileDate : parseInt ( fileDate ) * 1000 ,
224+ } ) ;
225+ }
225226 }
226227 return contents ;
227228 }
You can’t perform that action at this time.
0 commit comments