From 075bc04a2bc2903467f00910f6a9568e4dd98621 Mon Sep 17 00:00:00 2001 From: Tom <20648924+moT01@users.noreply.github.com> Date: Thu, 23 Dec 2021 00:51:03 -0600 Subject: [PATCH] fix: step-1 crashing (#44561) --- client/src/templates/Challenges/classic/editor.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/templates/Challenges/classic/editor.tsx b/client/src/templates/Challenges/classic/editor.tsx index 8f8a9026104..c8193422793 100644 --- a/client/src/templates/Challenges/classic/editor.tsx +++ b/client/src/templates/Challenges/classic/editor.tsx @@ -907,8 +907,8 @@ const Editor = (props: EditorProps): JSX.Element => { if (!previewOpen && showProjectPreview) { const description = document.getElementsByClassName( 'description-container' - )[0]; - description.classList.add('description-highlighter'); + )?.[0]; + description?.classList.add('description-highlighter'); } // eslint-disable-next-line react-hooks/exhaustive-deps }, [props.previewOpen]);