mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-21 01:25:37 -05:00
Check for valid uri/resource (#9593)
* Check for valid uri/resource * Add a few other cases
This commit is contained in:
@@ -57,7 +57,7 @@ export function replaceConnection(oldUri: string, newUri: string, connectionServ
|
||||
*
|
||||
* @param topLevelOnly If true, only return top-level (i.e. connected) Object Explorer connections instead of database connections when appropriate
|
||||
*/
|
||||
export function getCurrentGlobalConnection(objectExplorerService: IObjectExplorerService, connectionManagementService: IConnectionManagementService, workbenchEditorService: IEditorService, topLevelOnly: boolean = false): IConnectionProfile {
|
||||
export function getCurrentGlobalConnection(objectExplorerService: IObjectExplorerService, connectionManagementService: IConnectionManagementService, workbenchEditorService: IEditorService, topLevelOnly: boolean = false): IConnectionProfile | undefined {
|
||||
let connection: IConnectionProfile;
|
||||
// object Explorer Connection
|
||||
let objectExplorerSelection = objectExplorerService.getSelectedProfileAndDatabase();
|
||||
@@ -78,9 +78,9 @@ export function getCurrentGlobalConnection(objectExplorerService: IObjectExplore
|
||||
let activeInput = workbenchEditorService.activeEditor;
|
||||
if (activeInput) {
|
||||
// dashboard Connection
|
||||
if (activeInput instanceof DashboardInput) {
|
||||
if (activeInput instanceof DashboardInput && activeInput.uri) {
|
||||
connection = connectionManagementService.getConnectionProfile(activeInput.uri.toString());
|
||||
} else {
|
||||
} else if (activeInput.resource) {
|
||||
// editor Connection
|
||||
connection = connectionManagementService.getConnectionProfile(activeInput.resource.toString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user