Преглед изворни кода

panels: fix loading panels with non-array targets

Alexander Zobnin пре 6 година
родитељ
комит
e3b3b35dca
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      public/app/features/dashboard/state/PanelModel.ts

+ 2 - 1
public/app/features/dashboard/state/PanelModel.ts

@@ -126,7 +126,8 @@ export class PanelModel {
 
 
   ensureQueryIds() {
   ensureQueryIds() {
     if (this.targets) {
     if (this.targets) {
-      for (const query of this.targets) {
+      for (let i = 0; i < this.targets.length; i++) {
+        const query = this.targets[i];
         if (!query.refId) {
         if (!query.refId) {
           query.refId = this.getNextQueryLetter();
           query.refId = this.getNextQueryLetter();
         }
         }