diff --git a/app/assets/javascripts/discourse/components/menu-panel.js.es6 b/app/assets/javascripts/discourse/components/menu-panel.js.es6 index 7300b309f91..5fb1e034ab9 100644 --- a/app/assets/javascripts/discourse/components/menu-panel.js.es6 +++ b/app/assets/javascripts/discourse/components/menu-panel.js.es6 @@ -133,8 +133,7 @@ export default Ember.Component.extend({ this._resizeInterval = setInterval(() => { Ember.run(() => { const $panelBodyContents = this.$('.panel-body-contents'); - - if ($panelBodyContents.length) { + if ($panelBodyContents && $panelBodyContents.length) { const contentHeight = parseInt($panelBodyContents.height()); if (contentHeight !== this._lastHeight) { this.performLayout(); } this._lastHeight = contentHeight;