Skip to content

Commit 8048bd9

Browse files
authored
Merge pull request #83 from unipept/fix/pept2prot-crash
Fix crash in pept2prot because of empty result sets
2 parents 6fa195b + 57a7715 commit 8048bd9

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.devcontainer/devcontainer.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,21 @@
1313
},
1414

1515
// Use 'forwardPorts' to make a list of ports inside the container available locally.
16-
// "forwardPorts": [],
16+
"forwardPorts": [80],
1717

1818
// Use 'postCreateCommand' to run commands after the container is created.
19-
"postCreateCommand": "apt update && apt install --yes libmysqlclient-dev && rm /var/lib/opensearch/nodes/0/node.lock /var/lib/opensearch/nodes/0/_state/write.lock"
19+
"postCreateCommand": "apt update && apt install --yes libmysqlclient-dev && rm /var/lib/opensearch/nodes/0/node.lock /var/lib/opensearch/nodes/0/_state/write.lock",
2020

2121
// Configure tool-specific properties.
2222
// "customizations": {},
2323

2424
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
25-
// "remoteUser": "root"
25+
// "remoteUser": "root",
26+
"customizations": {
27+
"jetbrains": {
28+
"settings": {
29+
"com.intellij:app:HttpConfigurable.use_proxy_pac": true
30+
}
31+
}
32+
}
2633
}

api/src/controllers/api/pept2prot.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ async fn handler(
6565
.flat_map(|item| item.proteins.iter().map(|protein| protein.uniprot_accession.clone()))
6666
.collect();
6767

68+
if accession_numbers.is_empty() {
69+
return Ok(vec![]);
70+
}
71+
6872
let accessions_map = get_accessions_map(connection, &accession_numbers)
6973
.await
7074
.map_err(|e| {

0 commit comments

Comments
 (0)