From ef71d52ec0d63e926af2f75de33774158ab33695 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Thu, 24 Nov 2022 12:51:56 +0000 Subject: [PATCH] Fixed `Cannot read properties of null (reading 'offsetHeight')` errors in markdown card closes sentry ADMIN-CAV - the mobile nav element is not always displayed so we should assume we can read it's `offsetHeight` property --- .../lib/koenig-editor/addon/components/koenig-card-markdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/admin/lib/koenig-editor/addon/components/koenig-card-markdown.js b/ghost/admin/lib/koenig-editor/addon/components/koenig-card-markdown.js index f346776ad0..7f1e88b681 100644 --- a/ghost/admin/lib/koenig-editor/addon/components/koenig-card-markdown.js +++ b/ghost/admin/lib/koenig-editor/addon/components/koenig-card-markdown.js @@ -203,7 +203,7 @@ export default class KoenigCardMarkdown extends Component { if (style === fixedBottom) { let mobileNav = document.querySelector('.gh-mobile-nav-bar'); - if (mobileNav.offsetHeight) { + if (mobileNav?.offsetHeight) { style = `${style}; bottom: ${mobileNav.offsetHeight}px`; } }