File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
workspaces/ballerina/ballerina-visualizer/src/views/DataMapper Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -370,9 +370,14 @@ export function DataMapperView(props: DataMapperProps) {
370370 targetField : targetField ,
371371 index : index
372372 } ) ;
373- return position ;
373+ if ( position ) {
374+ return position ;
375+ } else {
376+ throw new Error ( "Clause position not found" ) ;
377+ }
374378 } catch ( error ) {
375379 console . error ( error ) ;
380+ return { line : 0 , offset : 0 } ;
376381 }
377382 }
378383
@@ -548,7 +553,12 @@ export function DataMapperView(props: DataMapperProps) {
548553 codedata : viewState . codedata ,
549554 targetField : viewId
550555 } )
551- // TODO: need to handle undfined property case
556+
557+ if ( ! property ?. codedata ?. lineRange ?. startLine ) {
558+ console . error ( "Failed to get start line for generating unique name" ) ;
559+ return name ;
560+ }
561+
552562 const completions = await rpcClient . getBIDiagramRpcClient ( ) . getDataMapperCompletions ( {
553563 filePath,
554564 context : {
You can’t perform that action at this time.
0 commit comments