This is an automated email from the ASF dual-hosted git repository.

villebro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new db2135109a fix(dataset): avoid crash if database missing (#19582)
db2135109a is described below

commit db2135109a2b41240547653c845854422adaa92b
Author: Ville Brofeldt <[email protected]>
AuthorDate: Thu Apr 7 13:43:17 2022 +0300

    fix(dataset): avoid crash if database missing (#19582)
---
 superset-frontend/src/components/Datasource/DatasourceEditor.jsx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/superset-frontend/src/components/Datasource/DatasourceEditor.jsx 
b/superset-frontend/src/components/Datasource/DatasourceEditor.jsx
index 1b6de1c7a9..15f9afa447 100644
--- a/superset-frontend/src/components/Datasource/DatasourceEditor.jsx
+++ b/superset-frontend/src/components/Datasource/DatasourceEditor.jsx
@@ -1001,10 +1001,10 @@ class DatasourceEditor extends React.PureComponent {
                         database={{
                           ...datasource.database,
                           database_name:
-                            datasource.database.database_name ||
-                            datasource.database.name,
+                            datasource.database?.database_name ||
+                            datasource.database?.name,
                         }}
-                        dbId={datasource.database.id}
+                        dbId={datasource.database?.id}
                         handleError={this.props.addDangerToast}
                         schema={datasource.schema}
                         sqlLabMode={false}

Reply via email to