File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed
vaadin-dev-server/src/main/resources/META-INF/frontend Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,10 @@ export class ComponentPicker extends LitElement {
139
139
140
140
pickSelectedComponent ( ) {
141
141
const component = this . components [ this . selected ] ;
142
+ if ( ! component ) {
143
+ this . abort ( ) ;
144
+ return ;
145
+ }
142
146
this . dispatchEvent (
143
147
new CustomEvent ( 'component-picker-pick' , {
144
148
detail : { component : { nodeId : component . nodeId , uiId : component . uiId } }
Original file line number Diff line number Diff line change @@ -22,14 +22,17 @@ export function getComponents(element: HTMLElement): ComponentReference[] {
22
22
}
23
23
24
24
function getComponent ( element : HTMLElement ) : ComponentReference {
25
- const { clients } = ( window as any ) . Vaadin . Flow ;
26
- const appIds = Object . keys ( clients ) ;
27
- for ( const appId of appIds ) {
28
- const client = clients [ appId ] ;
29
- if ( client . getNodeId ) {
30
- const nodeId = client . getNodeId ( element ) ;
31
- if ( nodeId >= 0 ) {
32
- return { nodeId, uiId : client . getUIId ( ) , element } ;
25
+ const vaadin = ( window as any ) . Vaadin ;
26
+ if ( vaadin && vaadin . Flow ) {
27
+ const { clients } = vaadin . Flow ;
28
+ const appIds = Object . keys ( clients ) ;
29
+ for ( const appId of appIds ) {
30
+ const client = clients [ appId ] ;
31
+ if ( client . getNodeId ) {
32
+ const nodeId = client . getNodeId ( element ) ;
33
+ if ( nodeId >= 0 ) {
34
+ return { nodeId, uiId : client . getUIId ( ) , element } ;
35
+ }
33
36
}
34
37
}
35
38
}
You can’t perform that action at this time.
0 commit comments