Skip to content

Commit

Permalink
Merge pull request #1007 from nataliauvarova/staging
Browse files Browse the repository at this point in the history
#971: fix data_type
  • Loading branch information
nataliauvarova authored Jul 14, 2023
2 parents 16a3797 + 3a9a446 commit dd3a448
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/DistanceMap/getDistancePerspectives.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const getDistance = async (dictionaries, allField, mainDictionary, computeDistan
sourcePerspectiveId = el.id;
groupFields = el.columns
.map(column => fieldDict[id2str(column.field_id)])
.filter(field => field.data_type === "Grouping Tag");
.filter(field => (field && field.data_type && (field.data_type === "Grouping Tag")));
}
});

Expand All @@ -48,11 +48,11 @@ const getDistance = async (dictionaries, allField, mainDictionary, computeDistan
perspective.columns.forEach(column => {
const field = fieldDict[id2str(column.field_id)];

if (field.data_type === "Grouping Tag") {
if (field && field.data_type && (field.data_type === "Grouping Tag")) {
pgroupFlag = true;
}

if (field.data_type === "Text") {
if (field && field.data_type && (field.data_type === "Text")) {
textFlag = true;
}
});
Expand All @@ -67,7 +67,7 @@ const getDistance = async (dictionaries, allField, mainDictionary, computeDistan

textFields = perspective.columns
.map(column => fieldDict[id2str(column.field_id)])
.filter(field => field.data_type === "Text");
.filter(field => (field && field.data_type && (field.data_type === "Text")));

let transcriptionFieldIdStr = "";
let translationFieldIdStr = "";
Expand Down

0 comments on commit dd3a448

Please sign in to comment.