From 13f0b268758d658eaa90f63e2d34146974d564e1 Mon Sep 17 00:00:00 2001 From: ajugo Date: Mon, 26 Jun 2023 11:54:54 +0200 Subject: [PATCH] Fix uploading of old protocol tables [SCI-8736] (#5673) --- app/assets/javascripts/protocols/import_export/import.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/protocols/import_export/import.js b/app/assets/javascripts/protocols/import_export/import.js index 5be91cd08..ac0a16298 100644 --- a/app/assets/javascripts/protocols/import_export/import.js +++ b/app/assets/javascripts/protocols/import_export/import.js @@ -257,10 +257,10 @@ function importProtocolFromFile( } function addTablePreview(stepEl, tableNode) { - var tableId = $(tableNode).attr('id'); var tableName = $(tableNode).children('name').text(); var tableContent = $(tableNode).children('contents').text(); - var tableMetadata = JSON.parse($(tableNode).children('metadata').text()) || {}; + var metadata = $(tableNode).children('metadata').text(); + var tableMetadata = metadata ? JSON.parse(metadata) : {}; // Generate table element var tableEl = newPreviewElement(