Skip to content

Commit

Permalink
Rudimentary error handling
Browse files Browse the repository at this point in the history
An unknown modal element is supposedly lacking a description, so in an attempt to circumvent the issue and determine the root cause I am going to simply return an empty element in that scenario.
  • Loading branch information
ajmeese7 committed Jun 6, 2022
1 parent 25eb697 commit 3410f07
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/templates/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Theme } from "@rebass/preset";

// @ts-ignore
const Modal = ({ location }) => {
if (!location.state) return <></>;
const content = <ReactMarkdown children={location.state.description} components={components} />;

return <ThemeProvider theme={theme as Theme}>
Expand Down

0 comments on commit 3410f07

Please sign in to comment.