Skip to content

Commit edb8ba4

Browse files
authored
added safe navigation for when moleculartesttype is nil in data (#170)
1 parent 2118c5e commit edb8ba4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/import/colorectal/providers/manchester/manchester_handler_colorectal.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def extract_genes_from_raw_fields
139139
exon = raw_record['exon']
140140
genotype2 = raw_record['genotype2']
141141
next if MSH6_DOSAGE_MTYPE.include?(moltesttype) && !exon.scan(/MLPA/i).size.positive?
142-
next if moltesttype.match?(/dosage/i) && !exon.match?(/MLPA|P003/i)
142+
next if moltesttype&.match?(/dosage/i) && !exon.match?(/MLPA|P003/i)
143143

144144
genes_found << find_genes_genotype(exon, moltesttype, genotype, genotype2)
145145
end
@@ -152,7 +152,7 @@ def find_genes_genotype(exon, moltesttype, genotype, genotype2)
152152
genotype2_genes = genotype2&.scan(COLORECTAL_GENES_REGEX).to_a
153153
if exon.match?('NGS')
154154
genotype == 'No pathogenic variant identified' ? exon_genes : genotype_genes
155-
elsif exon.match?(/P003/i) && moltesttype.match?(/dosage/i)
155+
elsif exon.match?(/P003/i) && moltesttype&.match?(/dosage/i)
156156
%w[MLH1 MSH2] + [genotype_genes + genotype2_genes]
157157
elsif exon == 'MLH1_MSH2_MSH6_NGS-POOL' &&
158158
genotype == 'No pathogenic variant identified'

0 commit comments

Comments
 (0)