Skip to content

Commit

Permalink
Don't go to backend if no biosampleId
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhayhurst committed Sep 25, 2024
1 parent 0f776bd commit 7fab2c9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/models/entities/GwasIndex.scala
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ object GwasIndex extends Logging {
Some("Biosample"),
resolve = js => {
val biosampleId = (js.value \ "biosampleFromSourceId").asOpt[String].getOrElse("")
logger.info(s"Finding biosample: $biosampleId")
js.ctx.getBiosample(biosampleId)
if (biosampleId.isEmpty) {
None
} else {
js.ctx.getBiosample(biosampleId)
}
}
),
Field(
Expand Down

0 comments on commit 7fab2c9

Please sign in to comment.