From 02fd34d2690f07ec84d61e21547e5452f4391be9 Mon Sep 17 00:00:00 2001 From: Amanda Li Date: Mon, 1 Feb 2021 03:04:32 -0500 Subject: [PATCH] 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 Co-authored-by: Amin Yahyaabadi --- src/project.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/project.js b/src/project.js index 002408863..d917c6fe8 100644 --- a/src/project.js +++ b/src/project.js @@ -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.