File tree Expand file tree Collapse file tree
packages/libraries/laboratory/src/components/laboratory Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -192,15 +192,19 @@ export const ResponseQueryPlan = ({ historyItem }: { historyItem?: LaboratoryHis
192192 const [ mode , setMode ] = useState < 'text' | 'visual' > ( 'text' ) ;
193193
194194 const queryPlan = useMemo ( ( ) => {
195- const queryPlan =
196- JSON . parse ( ( historyItem as LaboratoryHistoryRequest ) ?. response ?? '{}' ) . extensions
197- ?. queryPlan ?? { } ;
195+ try {
196+ const queryPlan =
197+ JSON . parse ( ( historyItem as LaboratoryHistoryRequest ) ?. response ?? '{}' ) . extensions
198+ ?. queryPlan ?? { } ;
198199
199- if ( ! queryPlan ) {
200+ if ( ! queryPlan ) {
201+ return null ;
202+ }
203+
204+ return QueryPlanSchema . safeParse ( queryPlan ) . success ? queryPlan : null ;
205+ } catch {
200206 return null ;
201207 }
202-
203- return QueryPlanSchema . safeParse ( queryPlan ) . success ? queryPlan : null ;
204208 } , [ historyItem ] ) ;
205209
206210 return (
You can’t perform that action at this time.
0 commit comments