Skip to content

Commit

Permalink
Set gocams field to [] when undefined
Browse files Browse the repository at this point in the history
Refs #2169
  • Loading branch information
kimrutherford committed Jun 26, 2024
1 parent 7639017 commit f2f39a5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/pombase-api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ export class PombaseAPIService {
for (let fieldName of ['cv_annotations',
'genes_by_uniquename', 'genotypes_by_uniquename',
'alleles_by_uniquename', 'references_by_uniquename',
'terms_by_termid', 'annotation_details', 'gocams']) {
'terms_by_termid', 'annotation_details']) {
if (typeof(json[fieldName]) === 'undefined') {
json[fieldName] = {};
}
Expand All @@ -1210,6 +1210,10 @@ export class PombaseAPIService {
json.gene_history = [];
}

if (!json.gocams) {
json.gocams = [];
}

let genesByUniquename = json.genes_by_uniquename as GeneMap;
let genotypesByUniquename = json.genotypes_by_uniquename as GenotypeMap;
let allelesByUniquename = json.alleles_by_uniquename as AlleleMap;
Expand Down

0 comments on commit f2f39a5

Please sign in to comment.