mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Export: Fix error being thrown when exporting dashboards using query variables that reference the default datasource (#44034)
* handle undefined datasources, add unit test * slightly nicer
This commit is contained in:
@@ -116,7 +116,7 @@ export class DashboardExporter {
|
||||
pluginName: ds.meta?.name,
|
||||
};
|
||||
|
||||
if (obj.datasource === null || typeof obj.datasource === 'string') {
|
||||
if (!obj.datasource || typeof obj.datasource === 'string') {
|
||||
obj.datasource = '${' + refName + '}';
|
||||
} else {
|
||||
obj.datasource.uid = '${' + refName + '}';
|
||||
|
||||
Reference in New Issue
Block a user