Skip to content

Commit 0eb7c5b

Browse files
creilly8xzhou82
authored andcommitted
Correct validation check
1 parent 4a167bc commit 0eb7c5b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/routes/termdb.sampleScatter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ async function getSingleCellScatter(req, res, ds) {
158158
const { name, sample } = q.singleCellPlot
159159
try {
160160
const tw = q.colorTW as any // not using "TermWrapper" due to tsc err
161-
if (tw && !isSingleCellTerm(tw.term))
162-
throw new Error('colorTW must be a single cell term for single cell scatter plot')
161+
if (!tw || !isSingleCellTerm(tw.term))
162+
throw new Error('colorTW must be provided and be a single cell term for single cell scatter plot')
163163
const arg: any = { plots: [name], sample }
164164

165165
if (tw.term.type == SINGLECELL_GENE_EXPRESSION) arg.gene = tw.term.gene

0 commit comments

Comments
 (0)