File tree Expand file tree Collapse file tree
packages/debugger/src/locator Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -164,20 +164,13 @@ export function createLocator<TEl extends object>(props: {
164164 return
165165 }
166166
167- if ( comp . location == null ) {
168- DEV: { warn ( "Locator: can't find source location for component (comp=%o)" , comp ) }
169- return
170- }
171-
172- let source_code_data = locator . getSourceCodeData ( comp . location , comp . element as any )
173- if ( source_code_data == null ) {
174- DEV: { warn ( "Locator: can't find source code data for component (comp=%o)" , comp ) }
175- return
176- }
167+ let source_code_data = comp . location
168+ ? locator . getSourceCodeData ( comp . location , comp . element as any )
169+ : null
177170
178171 // intercept on-page components clicks and send them to the devtools overlay
179172 props . onComponentClick ( comp . id , ( ) => {
180- if ( target_ide == null ) return
173+ if ( target_ide == null || source_code_data == null ) return
181174 e . preventDefault ( )
182175 e . stopPropagation ( )
183176 locator . openSourceCode ( target_ide , source_code_data )
You can’t perform that action at this time.
0 commit comments