From eda73f5d1c82ca69145469f2c8cf29110f1a4f75 Mon Sep 17 00:00:00 2001
From: Remi Planel <rplanel@pasteur.fr>
Date: Fri, 1 Oct 2021 15:59:16 +0200
Subject: [PATCH] Check if history status defined

---
 .../pages/projects/_id/analysis/_analysisId/results.vue     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/client-nuxt/pages/projects/_id/analysis/_analysisId/results.vue b/client-nuxt/pages/projects/_id/analysis/_analysisId/results.vue
index 56c27a61..de27b673 100644
--- a/client-nuxt/pages/projects/_id/analysis/_analysisId/results.vue
+++ b/client-nuxt/pages/projects/_id/analysis/_analysisId/results.vue
@@ -73,7 +73,9 @@
           </v-card-text>
         </v-card>
       </v-dialog>
-      <v-card-text v-if="analysis.history_status.state === 'ok'">
+      <v-card-text
+        v-if="analysis.history_status && analysis.history_status.state === 'ok'"
+      >
         <genome-scan
           :series="highchartSerie"
           :threshold-values="significanceThresholds"
@@ -108,7 +110,7 @@ export default {
       `/api/projects/${projectId}/analysis/${analysisId}/`
     )
     const data = {}
-    if (analysis.history_status.state === 'ok') {
+    if (analysis?.history_status?.state === 'ok') {
       const [lod, significanceThresholds] = await Promise.all([
         $axios.$get(
           `/api/projects/${projectId}/analysis/${analysisId}/lodscores/`
-- 
GitLab