Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

File change throws "Cannot read property file of null" on NavigationAndHistory/main.js #12792

Closed
3 tasks done
petetnt opened this issue Sep 19, 2016 · 14 comments
Closed
3 tasks done

Comments

@petetnt
Copy link
Collaborator

petetnt commented Sep 19, 2016

Prerequisites

  • Can you reproduce the problem with Debug \ Reload Without Extensions?
  • Did you perform a cursory search to see if your bug or enhancement is already reported?
  • Did you read the Troubleshooting guide?

Description

For some time now (~5 days?) I have been getting the following errors every time I switch files. The fix would be trivial (checking for file first in the if-clause) but not sure yet what broke it in the first place. Need to do some debugging.

Steps to Reproduce

  1. Open a file

Expected behavior: [What you expected to happen]
File opens

Actual behavior: [What actually happened]

File is changed, but the following erros are thrown:

 Exception in 'currentFileChange' listener on Object TypeError: Cannot read property 'file' of null TypeError: Cannot read property 'file' of null
    at file:///Applications/Brackets.app/Contents/dev/src/extensions/default/NavigationAndHistory/main.js:589:27
    at t (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/lodash.js:6:249)
    at Function.<anonymous> (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/lodash.js:28:324)
    at _addToMROFList (file:///Applications/Brackets.app/Contents/dev/src/extensions/default/NavigationAndHistory/main.js:588:23)
    at handleCurrentFileChange (file:///Applications/Brackets.app/Contents/dev/src/extensions/default/NavigationAndHistory/main.js:772:10)
    at Object.trigger (file:///Applications/Brackets.app/Contents/dev/src/utils/EventDispatcher.js:229:40)
    at file:///Applications/Brackets.app/Contents/dev/src/view/MainViewManager.js:1106:29
    at Pane.trigger (file:///Applications/Brackets.app/Contents/dev/src/utils/EventDispatcher.js:229:40)
    at Pane._notifyCurrentViewChange (file:///Applications/Brackets.app/Contents/dev/src/view/Pane.js:890:14)
    at Pane.showView (file:///Applications/Brackets.app/Contents/dev/src/view/Pane.js:1202:14)
    at _showEditor (file:///Applications/Brackets.app/Contents/dev/src/editor/EditorManager.js:567:14)
    at Object.openDocument (file:///Applications/Brackets.app/Contents/dev/src/editor/EditorManager.js:639:13)
    at _edit (file:///Applications/Brackets.app/Contents/dev/src/view/MainViewManager.js:1198:23)
    at Object.<anonymous> (file:///Applications/Brackets.app/Contents/dev/src/view/MainViewManager.js:1262:21)
    at j (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.3.min.js:2:26911)
    at Object.k.fireWith [as resolveWith] (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.3.min.js:2:27724)
utils/EventDispatcher.js:232 

Assertion failed:utils/EventDispatcher.js:232 trigger

Versions

OSX El Capitan 10.11.6
Commit: a340c30, 1.8 pre-release shell but also occurs on 1.7

@zaggino zaggino added this to the Release 1.8 milestone Sep 19, 2016
@petetnt
Copy link
Collaborator Author

petetnt commented Sep 19, 2016

Suddenly it stopped doing that, without restarting/reloading or restarting Brackets 🤔 🤔

@ficristo
Copy link
Collaborator

Related #12629

@petetnt
Copy link
Collaborator Author

petetnt commented Sep 19, 2016

@ficristo Hah, I like how the chain goes on like my issue - your issue - my issue... 😆

@ghost
Copy link

ghost commented Oct 11, 2016

I have been having this exact same problem too, but it has not stopped for me. I am using Windows 10 Version 1511 (OS Build 10586.589) on a 64bit processor.

@ficristo
Copy link
Collaborator

@corfeur12 have you tryed File \ Open Recent Files... and then press the Clear button?
I don't think it is a real fix, but as a temporary workaround could help.

@ghost
Copy link

ghost commented Oct 12, 2016

@ficristo I have just done that and it seems to have fixed it, thank you

@swmitra
Copy link
Collaborator

swmitra commented Oct 19, 2016

@zaggino @petetnt @ficristo I am pushing this issue to 1.9 milestone.

@swmitra
Copy link
Collaborator

swmitra commented Jun 28, 2017

This will be fixed as part of #13418 .

@petetnt
Copy link
Collaborator Author

petetnt commented Jun 28, 2017

@swmitra
Copy link
Collaborator

swmitra commented Jun 28, 2017

Yes @petetnt

@swmitra
Copy link
Collaborator

swmitra commented Jun 28, 2017

@petetnt #13418 is merged and available as part of pre-release 3 builds. Can you please verify this defect and close if not reproducible?

@petetnt
Copy link
Collaborator Author

petetnt commented Jun 28, 2017

Sure thing @swmitra, I haven't figured out repro steps (!) for this one, but I haven't had the issue anymore when I fixed it locally. Closing as fixed, nice work.

@petetnt petetnt closed this as completed Jun 28, 2017
@petetnt petetnt reopened this Jun 29, 2017
@petetnt
Copy link
Collaborator Author

petetnt commented Jun 29, 2017

Still not fixed after all. Something is still inserting null values to mroflist and this is throwing again:

        // Check existing list for this doc path and pane entry
        var index = _.findIndex(_mrofList, function (record) {
            return (record.file === filePath && record.paneId === paneId);
        });

Switching branches on git while brackets is open is a good way to replicate this.

@swmitra
Copy link
Collaborator

swmitra commented Jun 29, 2017

Should be fixed now by #13495 🤕

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants