File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -193,12 +193,17 @@ export class KdbResultsViewProvider implements WebviewViewProvider {
193193 updatedExtractRowData ( results : StructuredTextResults ) {
194194 const { columns } = results ;
195195 const columnsArray = Array . isArray ( columns ) ? columns : [ columns ] ;
196- const dataLength =
197- columnsArray . length > 0
198- ? Array . isArray ( columnsArray [ 0 ] . values )
199- ? columnsArray [ 0 ] . values . length
200- : 1
201- : 0 ;
196+
197+ let dataLength = 0 ;
198+ if ( columnsArray . length > 0 ) {
199+ const firstColumnValues = columnsArray [ 0 ] . values ;
200+ if ( Array . isArray ( firstColumnValues ) ) {
201+ dataLength = firstColumnValues . length ;
202+ } else {
203+ dataLength = 1 ;
204+ }
205+ }
206+
202207 const rowData : { [ key : string ] : any } [ ] = Array . from (
203208 { length : dataLength } ,
204209 ( ) => ( { } ) ,
You can’t perform that action at this time.
0 commit comments