From 37bdaa18424c60ee19b522f1d35390821c947e55 Mon Sep 17 00:00:00 2001
From: HongKee Moon <moon@mpi-cbg.de>
Date: Mon, 20 Jun 2022 13:29:24 +0200
Subject: [PATCH] Close dd-code-team/dd-code-web#91: Cannot add pubmed id in
 the condensateDetailPage

---
 web/src/components/CMS/addDeletePubmed.vue | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/web/src/components/CMS/addDeletePubmed.vue b/web/src/components/CMS/addDeletePubmed.vue
index 2334fba..90e7068 100644
--- a/web/src/components/CMS/addDeletePubmed.vue
+++ b/web/src/components/CMS/addDeletePubmed.vue
@@ -641,9 +641,11 @@ export default {
             pubmedData = data[key];
           }
         }
-        for (let item of pubmedData) {
-          if (this.pubmedId === item) {
-            foundPubId = item;
+        if(pubmedData) {
+          for (let item of pubmedData) {
+            if (this.pubmedId === item) {
+              foundPubId = item;
+            }
           }
         }
       } else if (this.mode === 'protein' && this.actionType === 'Add' && Object.keys(data).length > 0) {
@@ -665,7 +667,7 @@ export default {
         this.isValid = false;
         this.commentError = '';
         this.error =
-          'Given pubmed id is aready present. Please add another pubmed id.';
+          'Given pubmed id is already present. Please add another pubmed id.';
 
         return false;
       }
-- 
GitLab