Skip to content

Commit

Permalink
dbeaver/pro#2424 NPE fix in virtual model read
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-rider committed Feb 2, 2024
1 parent 0393728 commit 5b17087
Showing 1 changed file with 2 additions and 3 deletions.
Expand Up @@ -31,7 +31,6 @@
import org.jkiss.dbeaver.model.struct.*;
import org.jkiss.dbeaver.model.struct.rdb.DBSForeignKeyModifyRule;
import org.jkiss.dbeaver.model.struct.rdb.DBSTableForeignKey;
import org.jkiss.dbeaver.runtime.DBWorkbench;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -251,9 +250,9 @@ public DBPDataSourceContainer getAssociatedDataSource() {
return null;
}
DBPProject project = getParentObject().getProject();
DBNModel navModel = DBWorkbench.getPlatform().getNavigatorModel();
DBNModel navModel = project.getNavigatorModel();

DBNDataSource dsNode = navModel.getDataSourceByPath(project, refEntityId);
DBNDataSource dsNode = navModel == null ? null : navModel.getDataSourceByPath(project, refEntityId);
return dsNode == null ? null : dsNode.getDataSourceContainer();
}

Expand Down

0 comments on commit 5b17087

Please sign in to comment.