react-panel: Add nullcheck to prevent error on datasources without meta options

This commit is contained in:
Johannes Schill 2018-11-30 13:42:49 +01:00
parent e0fb89cf54
commit 0b65558c21

View File

@ -202,10 +202,12 @@ export class QueriesTab extends PureComponent<Props, State> {
},
};
const dsOptions = Object.keys(queryOptions).map(key => {
const options = allOptions[key];
return <DataSourceOption key={key} {...options} onChange={onChangeFn(allOptions[key].panelKey || key)} />;
});
const dsOptions = queryOptions
? Object.keys(queryOptions).map(key => {
const options = allOptions[key];
return <DataSourceOption key={key} {...options} onChange={onChangeFn(allOptions[key].panelKey || key)} />;
})
: null;
return (
<>