Resolve Uncaught TypeError (#16392)

A `TypeError` raised when a certain file, or lack thereof, causes Atom to open improperly, without the side pane appearing. To fix this, users must clear their Atom window state, then reopen the program. Add a notification when this error occurs with information on how to resolve it.

Co-authored-by: Sadick <sadickjunior@gmail.com>
Co-authored-by: Amin Yahyaabadi <aminyahyaabadi74@gmail.com>
This commit is contained in:
Amanda Li
2021-02-01 03:04:32 -05:00
committed by GitHub
parent ee27540065
commit 02fd34d269

View File

@@ -350,7 +350,13 @@ module.exports = class Project extends Model {
// Public: Get an {Array} of {String}s containing the paths of the project's
// directories.
getPaths() {
return this.rootDirectories.map(rootDirectory => rootDirectory.getPath());
try {
return this.rootDirectories.map(rootDirectory => rootDirectory.getPath());
} catch (e) {
atom.notifications.addError(
"Please clear Atom's window state with: atom --clear-window-state"
);
}
}
// Public: Set the paths of the project's directories.