Skip to content

Commit

Permalink
fix(app): Prevent crash when top datasets query returns no datasets (…
Browse files Browse the repository at this point in the history
…new dev instance)
  • Loading branch information
nellh committed Dec 11, 2023
1 parent 62f0c23 commit 1d7f88b
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ export const FrontPageTopQuery = ({ query }) => {
</>
)
} else if (result.error || result.data.datasets == null) {
apm.captureError(result.error)
if (result?.error) {
apm.captureError(result?.error)
}
return <div>Failed to load top datasets, please try again later.</div>
} else {
// Remove any edges which could not be loaded
Expand Down Expand Up @@ -138,7 +140,9 @@ export const FrontPageNewQuery = ({ query }) => {
if (result.loading) {
return <Loading />
} else if (result.error || result.data.datasets == null) {
apm.captureError(result.error)
if (result?.error) {
apm.captureError(result?.error)
}
return <div>Failed to load top datasets, please try again later.</div>
} else {
// Remove any edges which could not be loaded
Expand Down

0 comments on commit 1d7f88b

Please sign in to comment.