From 24ca99e9257895ec03d08828bc03c30035bbda51 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Fri, 26 Feb 2016 10:55:31 -0800 Subject: [PATCH] fix(focus): Focusing quickly enough can throw. Sentry #14942 --- src/window-bootstrap.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window-bootstrap.coffee b/src/window-bootstrap.coffee index 479b78220..990f42d35 100644 --- a/src/window-bootstrap.coffee +++ b/src/window-bootstrap.coffee @@ -16,5 +16,5 @@ NylasEnv.startRootWindow() # Workaround for focus getting cleared upon window creation windowFocused = -> window.removeEventListener('focus', windowFocused) - setTimeout (-> document.getElementById('sheet-container').focus()), 0 + setTimeout (-> document.getElementById('sheet-container')?.focus()), 0 window.addEventListener('focus', windowFocused)