mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
Revert "explorer model: guard against children with no names"
This reverts commit d1cc4257bd
.
This commit is contained in:
parent
471d79cca6
commit
62f3ebeb0f
|
@ -216,17 +216,16 @@ export class ExplorerItem {
|
|||
* Adds a child element to this folder.
|
||||
*/
|
||||
public addChild(child: ExplorerItem): void {
|
||||
if (child && child.name) {
|
||||
// Inherit some parent properties to child
|
||||
child.parent = this;
|
||||
child.updateResource(false);
|
||||
|
||||
this.children.set(this.getPlatformAwareName(child.name), child);
|
||||
}
|
||||
// Inherit some parent properties to child
|
||||
child.parent = this;
|
||||
child.updateResource(false);
|
||||
|
||||
this.children.set(this.getPlatformAwareName(child.name), child);
|
||||
}
|
||||
|
||||
public getChild(name: string): ExplorerItem {
|
||||
if (!this.children || !name) {
|
||||
if (!this.children) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
@ -274,9 +273,7 @@ export class ExplorerItem {
|
|||
* Removes a child element from this folder.
|
||||
*/
|
||||
public removeChild(child: ExplorerItem): void {
|
||||
if (child && child.name) {
|
||||
this.children.delete(this.getPlatformAwareName(child.name));
|
||||
}
|
||||
this.children.delete(this.getPlatformAwareName(child.name));
|
||||
}
|
||||
|
||||
private getPlatformAwareName(name: string): string {
|
||||
|
|
Loading…
Reference in a new issue