From 1d6ac0ffbc783c43a04b6cbdef352c4c52c39115 Mon Sep 17 00:00:00 2001 From: Mahdi Yari <16903082+mahdiyari@users.noreply.github.com> Date: Tue, 18 Feb 2025 02:53:40 +0330 Subject: [PATCH] Check for metadata --- src/app/components/elements/PostCountDown.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/components/elements/PostCountDown.jsx b/src/app/components/elements/PostCountDown.jsx index 25c4d0df..9eb30445 100644 --- a/src/app/components/elements/PostCountDown.jsx +++ b/src/app/components/elements/PostCountDown.jsx @@ -7,6 +7,9 @@ import classnames from 'classnames'; const PostCountDown = (props) => { const { post } = props; const jsonMetadata = post.get('json_metadata'); + if (!jsonMetadata || !jsonMetadata.get) { + return null + } const countDownEndDate = jsonMetadata.get('countdown'); const [remainingTime, setRemainingTime] = useState(); const [intervalHandler, setIntervalHandler] = useState(); -- GitLab