Skip to content

Commit

Permalink
Merge pull request #2957 from OpenNeuroOrg/fix/front-page-dev-crash
Browse files Browse the repository at this point in the history
fix(app): Prevent crash when top datasets query returns no datasets
nellh authored Dec 11, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 62f0c23 + 1d7f88b commit 86ef124
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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
@@ -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

0 comments on commit 86ef124

Please sign in to comment.