Fix uploading of old protocol tables [SCI-8736] (#5673)

This commit is contained in:
ajugo 2023-06-26 11:54:54 +02:00 committed by GitHub
parent 8bf8b9cc72
commit 13f0b26875
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(