Skip to content

Commit

Permalink
ispras#971: fix data_type
Browse files Browse the repository at this point in the history
  • Loading branch information
nataliauvarova committed Jul 14, 2023
1 parent 66f8b0e commit 3a9a446
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 3a9a446

Please sign in to comment.