Skip to content

Commit

Permalink
Fixed strict parsing on empty fields (Issue #214) 🐛
Browse files Browse the repository at this point in the history
  • Loading branch information
Freymaurer committed Jul 14, 2022
1 parent 027e9c2 commit 0b5be6d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Client/OfficeInterop/Functions/BuildingBlockFunctions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,12 @@ let toTermSearchable (buildingBlock:BuildingBlock) =
let tryFindAccession =
buildingBlock.TAN.Value.Cells
// filter for only row indices related to main column term name
|> Array.filter (fun x -> Array.contains x.Index cellRowIndices)
|> Array.filter (fun x -> Array.contains x.Index cellRowIndices && x.Value.IsSome && x.Value.Value.Trim() <> "")
|> Array.sortBy (fun x -> x.Index)
|> Array.distinctBy (fun x -> x.Value)
// Return error if one term name in row relates to different accessions
if tryFindAccession.Length > 1 then
let rowIndices = tryFindAccession|> Array.map (fun x -> string x.Index) |> String.concat ", "
let rowIndices = tryFindAccession |> Array.map (fun x -> string x.Index) |> String.concat ", "
failwith $"Swate found different accessions for the same Term! Please check column '{buildingBlock.MainColumn.Header.SwateColumnHeader}', different accession for rows: {rowIndices}."
let accession =
tryFindAccession
Expand Down

0 comments on commit 0b5be6d

Please sign in to comment.