diff --git a/app/controllers/private_api/proteins_controller.rb b/app/controllers/private_api/proteins_controller.rb index a4f82f3..bee7315 100644 --- a/app/controllers/private_api/proteins_controller.rb +++ b/app/controllers/private_api/proteins_controller.rb @@ -21,9 +21,12 @@ def proteins # Request the suffix array search service search_result = search([ peptide ], equate_il) + if search_result.empty? + return + end # Collect all protein information - @proteins = UniprotEntry.where(uniprot_accession_number: search_result["uniprot_accessions"]) + @proteins = UniprotEntry.where(uniprot_accession_number: search_result[0]["uniprot_accessions"]) @lca = search_result["lca"] || -1