From 41246a0fa02ea8a79aa0d0f86a46f60e21c69066 Mon Sep 17 00:00:00 2001 From: Louis Chu Date: Wed, 19 Apr 2023 08:35:29 -0700 Subject: [PATCH] Bugfix on right-hand-side single search Signed-off-by: Louis Chu --- .../query_compare/search_result/index.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/public/components/query_compare/search_result/index.tsx b/public/components/query_compare/search_result/index.tsx index a0d058f..e9a65d3 100644 --- a/public/components/query_compare/search_result/index.tsx +++ b/public/components/query_compare/search_result/index.tsx @@ -104,10 +104,15 @@ export const SearchResult = ({ http }: SearchResultProps) => { body: JSON.stringify(requestBody), }) .then((res) => { - setQueryResult1(res.result1); - updateComparedResult1(res.result1); - setQueryResult2(res.result2); - updateComparedResult2(res.result2); + if (res.result1) { + setQueryResult1(res.result1); + updateComparedResult1(res.result1); + } + + if (res.result2) { + setQueryResult2(res.result2); + updateComparedResult2(res.result2); + } if (res.errorMessage1) { setQueryError1({