refactor: Add conditional chaining to session-manager call

This commit is contained in:
Susmitha Girumala committed 2021-05-14 15:08:06 -04:00
1 parent aab980a7dc
commit f2f5a46cdf
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -200,7 +200,7 @@ app.on('before-quit', (event) => {
case 0:
sessionManager.stopAll();
break;
case 1:
default:
event.preventDefault();
break;
}
@@ -31,7 +31,7 @@ class SessionManager {
*/
stopById(session_id) {
const session = this.#sessions.find((session) => session.id === session_id);
return session && session.stop();
return session?.stop?.();
}
stopAll() {