diff --git a/vacs-map-app/src/components/ExploreSidebar.vue b/vacs-map-app/src/components/ExploreSidebar.vue index 29576db..264ac27 100644 --- a/vacs-map-app/src/components/ExploreSidebar.vue +++ b/vacs-map-app/src/components/ExploreSidebar.vue @@ -14,7 +14,7 @@ - {{ selectedCropInfo.description }} + {{ selectedCropInfo?.description }}
crop fingerprint
@@ -50,11 +50,11 @@ const { data: cropInformation } = storeToRefs(cropInformationStore) const futureScenarios = computed(() => availableModels.value.filter((d) => d.startsWith('future'))) const selectedCropInfo = computed(() => { - return cropInformation.value.find(d => d.id === selectedCrop.value); + return cropInformation?.value?.find(d => d.id === selectedCrop.value); }) const getCropsByGroup = (group) => { - return cropInformation.value.filter(crop => crop.crop_group === group); + return cropInformation?.value?.filter(crop => crop.crop_group === group); } diff --git a/vacs-map-app/src/components/MapContainerColorAcrossScenarios.vue b/vacs-map-app/src/components/MapContainerColorAcrossScenarios.vue index a9d7391..84589cb 100644 --- a/vacs-map-app/src/components/MapContainerColorAcrossScenarios.vue +++ b/vacs-map-app/src/components/MapContainerColorAcrossScenarios.vue @@ -68,7 +68,7 @@ const columns = computed(() => { }); const selectedExtent = computed(() => { - if (!columns.value.length) return null; + if (!columns.value?.length) return null; const extents = columns.value.map(c => cropYieldsStore.getExtent(c));