Skip to content

Commit

Permalink
Revert "explorer model: guard against children with no names"
Browse files Browse the repository at this point in the history
This reverts commit d1cc425.
  • Loading branch information
isidorn committed Apr 16, 2018
1 parent 471d79c commit 62f3ebe
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/vs/workbench/parts/files/common/explorerModel.ts
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 62f3ebe

Please sign in to comment.