DEV: Avoid site-header error when rendering fails (#22993)
When Ember rendering fails for some reason, `this.header` will be undefined. This causes site-header to raise an error, which often gets printed to the console more obviously than the actual root cause. This commit makes site-header fail more gracefully in this situation, to avoid it being a red-herring during development/debugging.
This commit is contained in:
parent
c996b7fe4b
commit
a38830c009
|
@ -486,7 +486,7 @@ export default SiteHeaderComponent.extend({
|
|||
this._resizeObserver = new ResizeObserver((entries) => {
|
||||
for (let entry of entries) {
|
||||
if (entry.contentRect) {
|
||||
const headerTop = this.header.offsetTop;
|
||||
const headerTop = this.header?.offsetTop;
|
||||
document.documentElement.style.setProperty(
|
||||
"--header-top",
|
||||
`${headerTop}px`
|
||||
|
|
Loading…
Reference in New Issue