Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'set' of undefined #48496

Closed
bpasero opened this issue Apr 24, 2018 · 3 comments
Closed

TypeError: Cannot read property 'set' of undefined #48496

bpasero opened this issue Apr 24, 2018 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug file-explorer Explorer widget issues verified Verification succeeded
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented Apr 24, 2018

I started on a fresh insiders opening a first folder, then added a second folder. Then I saved the workspace and hit refresh:

ERR Cannot read property 'set' of undefined: TypeError: Cannot read property 'set' of undefined
    at e.addChild (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2409:129)
    at file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:4694:92
    at Array.forEach (native)
    at file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:4694:70
    at Object.g [as _notify] (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:146:729)
    at Object.enter (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:150:61)
    at n.Class.derive._creator._run (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:151:866)
    at n.Class.derive._creator._completed (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:151:307)
    at Object.g [as _notify] (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:146:729)
    at Object.enter (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:150:61)
    at n.Class.derive._oncancel._run (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:151:866)
    at n.Class.derive._oncancel._completed (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:151:307)
    at file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2945:168
    at file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2946:31
    at file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:265:204
    at Function.<anonymous> (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2946:4)
    at file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:264:833
    at s (file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:264:364)
    at file:///Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:264:468
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)

Seems to be somewhere here:

image

@isidorn
Copy link
Contributor

isidorn commented Apr 24, 2018

@bpasero I could not repro following your steps, however looking at the code we have null guards for this.chidlren for all methods.
For now I decided to handle the case when somebody is adding children to a ExplorerItem that is not yet fully initialised to make this ExplorerItem a directory, thus initalizing the children array.
An alternative would be to ignore the add but in that case we could loose some children.

@isidorn isidorn added bug Issue identified by VS Code Team member as probable bug file-explorer Explorer widget issues labels Apr 24, 2018
@isidorn isidorn added this to the April 2018 milestone Apr 24, 2018
@bpasero
Copy link
Member Author

bpasero commented Apr 26, 2018

I tried to reproduce and cannot. I hope you know what you are doing with that change in the explorer model, I did not verify if that breaks anything...

@bpasero bpasero added the verified Verification succeeded label Apr 26, 2018
@isidorn
Copy link
Contributor

isidorn commented Apr 26, 2018

@bpasero thanks, if it breaks something I think we will see in insiders. Though it can break only already broken beahvior (trying to add children to a non folder)

@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug file-explorer Explorer widget issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

2 participants