0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

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
This commit is contained in:
Kevin Ansfield 2022-11-24 12:51:56 +00:00
parent 37d9e8bb8b
commit ef71d52ec0

View file

@ -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`;
}
}