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

[CLOSED] File change throws "Cannot read property file of null" on NavigationAndHistory/main.js #10896

Open
3 tasks done
core-ai-bot opened this issue Aug 30, 2021 · 14 comments
Open
3 tasks done

Comments

@core-ai-bot
Copy link
Member

Issue by petetnt
Monday Sep 19, 2016 at 07:11 GMT
Originally opened as adobe/brackets#12792


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

@core-ai-bot
Copy link
Member Author

Comment by petetnt
Monday Sep 19, 2016 at 10:20 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by ficristo
Monday Sep 19, 2016 at 19:14 GMT


Related adobe/brackets#12629

@core-ai-bot
Copy link
Member Author

Comment by petetnt
Monday Sep 19, 2016 at 19:20 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by corfeur12
Tuesday Oct 11, 2016 at 11:49 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by ficristo
Tuesday Oct 11, 2016 at 17:52 GMT


@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.

@core-ai-bot
Copy link
Member Author

Comment by corfeur12
Wednesday Oct 12, 2016 at 05:49 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by swmitra
Wednesday Oct 19, 2016 at 05:47 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by swmitra
Wednesday Jun 28, 2017 at 06:55 GMT


This will be fixed as part of #13418 .

@core-ai-bot
Copy link
Member Author

Comment by petetnt
Wednesday Jun 28, 2017 at 07:14 GMT


This line (https://github.com/adobe/brackets/pull/13418/files#diff-649cccfc4b4582653f0bc2c44978e56cR650) right?

@core-ai-bot
Copy link
Member Author

Comment by swmitra
Wednesday Jun 28, 2017 at 07:35 GMT


Yes@petetnt

@core-ai-bot
Copy link
Member Author

Comment by swmitra
Wednesday Jun 28, 2017 at 11:28 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by petetnt
Wednesday Jun 28, 2017 at 11:34 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by petetnt
Thursday Jun 29, 2017 at 13:13 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by swmitra
Thursday Jun 29, 2017 at 14:24 GMT


Should be fixed now by #13495 🤕

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

No branches or pull requests

1 participant