Do not crash if a project doesn't have QCs defined.

Fixes #195.
This commit is contained in:
D. Berge
2022-04-26 14:50:34 +02:00
parent 74d6f0b9a0
commit 888228c9a2
2 changed files with 2 additions and 2 deletions

View File

@@ -67,7 +67,7 @@ function makeTree (leaf, sequences, shots) {
async function get (projectId, sequenceId, opts = {}) {
const client = await setSurvey(projectId);
const tree = await definitions.get(projectId);
const tree = await definitions.get(projectId) ?? [];
const shots = await getShots(client, sequenceId);
const sequences = await getSequences(client, sequenceId);

View File

@@ -73,7 +73,7 @@ async function main () {
console.log("currentQCHash != lastQCHash", projectId, currentQCHash, lastQCHash);
// Fetch definitions and parameters
const { definitions, parameters } = await getProjectQCConfig(projectId);
const { definitions, parameters } = await getProjectQCConfig(projectId) ?? {};
if (definitions && parameters) {
console.log("PROJECT ID", projectId);