Explorar el Código

fix error when the sidebar is not visible

Tobias hace 5 años
padre
commit
446e29e422
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. 5 2
      client/components/sidebar/sidebar.js

+ 5 - 2
client/components/sidebar/sidebar.js

@@ -47,8 +47,11 @@ BlazeComponent.extendComponent({
   },
 
   calculateNextPeak() {
-    const altitude = this.find('.js-board-sidebar-content').scrollHeight;
-    this.callFirstWith(this, 'setNextPeak', altitude);
+    const sidebarElement = this.find('.js-board-sidebar-content');
+    if (sidebarElement) {
+      const altitude = sidebarElement.scrollHeight;
+      this.callFirstWith(this, 'setNextPeak', altitude);
+    }
   },
 
   reachNextPeak() {