mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Fix drag-n-drop null ref in OE (#2163)
This commit is contained in:
@@ -96,24 +96,24 @@ export class ServerTreeDragAndDrop implements IDragAndDrop {
|
|||||||
let targetConnectionProfileGroup: ConnectionProfileGroup = this.getTargetGroup(targetElement);
|
let targetConnectionProfileGroup: ConnectionProfileGroup = this.getTargetGroup(targetElement);
|
||||||
|
|
||||||
const source = data.getData()[0];
|
const source = data.getData()[0];
|
||||||
let oldParent: ConnectionProfileGroup = source.getParent();
|
if (source && source.getParent) {
|
||||||
const self = this;
|
let oldParent: ConnectionProfileGroup = source.getParent();
|
||||||
if (this.isDropAllowed(targetConnectionProfileGroup, oldParent, source)) {
|
const self = this;
|
||||||
|
if (this.isDropAllowed(targetConnectionProfileGroup, oldParent, source)) {
|
||||||
|
|
||||||
if (source instanceof ConnectionProfile) {
|
if (source instanceof ConnectionProfile) {
|
||||||
// Change group id of profile
|
// Change group id of profile
|
||||||
this._connectionManagementService.changeGroupIdForConnection(source, targetConnectionProfileGroup.id).then(() => {
|
this._connectionManagementService.changeGroupIdForConnection(source, targetConnectionProfileGroup.id).then(() => {
|
||||||
TreeUpdateUtils.registeredServerUpdate(tree, self._connectionManagementService, targetConnectionProfileGroup);
|
TreeUpdateUtils.registeredServerUpdate(tree, self._connectionManagementService, targetConnectionProfileGroup);
|
||||||
});
|
});
|
||||||
} else if (source instanceof ConnectionProfileGroup) {
|
} else if (source instanceof ConnectionProfileGroup) {
|
||||||
// Change parent id of group
|
// Change parent id of group
|
||||||
this._connectionManagementService.changeGroupIdForConnectionGroup(source, targetConnectionProfileGroup).then(() => {
|
this._connectionManagementService.changeGroupIdForConnectionGroup(source, targetConnectionProfileGroup).then(() => {
|
||||||
TreeUpdateUtils.registeredServerUpdate(tree, self._connectionManagementService);
|
TreeUpdateUtils.registeredServerUpdate(tree, self._connectionManagementService);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public dropAbort(tree: ITree, data: IDragAndDropData): void {
|
public dropAbort(tree: ITree, data: IDragAndDropData): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user