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