Преглед на файлове

feat(dasbboard): fix to issues when setting fullscreen/edit state for panel that have yet to get a scope

Torkel Ödegaard преди 10 години
родител
ревизия
e04678f33c
променени са 1 файла, в които са добавени 5 реда и са изтрити 0 реда
  1. 5 0
      public/app/features/dashboard/viewStateSrv.js

+ 5 - 0
public/app/features/dashboard/viewStateSrv.js

@@ -89,6 +89,11 @@ function (angular, _, $) {
           this.leaveFullscreen(false);
         }
         var panelScope = this.getPanelScope(this.state.panelId);
+        // panel could be about to be created/added and scope does
+        // not exist yet
+        if (!panelScope) {
+          return;
+        }
         this.enterFullscreen(panelScope);
         return;
       }