panels: fix loading panels with non-array targets (refactor)

This commit is contained in:
Alexander Zobnin 2019-03-15 10:26:56 +03:00
parent e3b3b35dca
commit fe798239b2
No known key found for this signature in database
GPG Key ID: E17E9ABACEFA59EB

View File

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