adobe/brackets — pull request #4539 by JeffryBooher (2013-07-22 22:52:00+00:00)
Title: Show Error when unable to modify a folder

* Fixes client #4456
* Adds another bit of safety when clicking on an item that isn't a file system object

The main problem was an exception was getting thrown because the folder was unwritable and Strings doesn't have a method breakableUrl(). That method comes from StringUtils so I fixed that and the message now appears and the file is removed after creation.

The other check was working my way through -- I noticed that data("entry") was returning undefined when creating new files that do not yet exist on disk. That may no longer be an issue since file entries that cannot be created are removed immediately by the ProjectManager but this check will prevent another crash if a non-existent file gets into the tree somehow in the future. That code was throwing an exception before so it didn't get a chance to execute the removal code but that isn't to say that someone else could add a code path that shows a file that doesn't exist on disk.