Showing
1 changed file
with
2 additions
and
1 deletions
... | ... | @@ -30,7 +30,7 @@ const { targetData, chartEditStore } = useTargetData() |
30 | 30 | const isWebsocket = computed(() => { |
31 | 31 | const result = query(chartEditStore.getComponentList) |
32 | 32 | if (result === false) return false |
33 | - | |
33 | + if (!targetData.value) return | |
34 | 34 | if (result.id === targetData.value.id) |
35 | 35 | return targetData.value.request.requestContentType as RequestContentTypeEnum === RequestContentTypeEnum.WEB_SOCKET |
36 | 36 | else { |
... | ... | @@ -42,6 +42,7 @@ function query(list: CreateComponentType[]) { |
42 | 42 | if (!list || !list?.length) return false |
43 | 43 | |
44 | 44 | for (const item of list) { |
45 | + if (!targetData.value) return | |
45 | 46 | if (item.id === targetData.value.id) { |
46 | 47 | return item |
47 | 48 | } | ... | ... |