Chore: Fix main build (#70424)

add check for empty object
This commit is contained in:
Ashley Harrison 2023-06-21 09:33:09 +01:00 committed by GitHub
parent 3c88868fe5
commit 0325fdecb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
import React, { PureComponent } from 'react';
import { SelectableValue } from '@grafana/data';
import { isEmptyObject, SelectableValue } from '@grafana/data';
import { getBackendSrv, reportInteraction } from '@grafana/runtime';
import { Button, ClipboardButton, Field, Input, LinkButton, Modal, Select, Spinner } from '@grafana/ui';
import { t, Trans } from 'app/core/internationalization';
@ -160,7 +160,7 @@ export class ShareSnapshot extends PureComponent<Props, State> {
variable.query = '';
}
if ('options' in variable) {
variable.options = variable.current ? [variable.current] : [];
variable.options = variable.current && !isEmptyObject(variable.current) ? [variable.current] : [];
}
if ('refresh' in variable) {
variable.refresh = VariableRefresh.never;