From f3f4d607621afb5c65fcebf63b4a92a28342e9d6 Mon Sep 17 00:00:00 2001 From: Dustan Kasten Date: Tue, 11 Aug 2015 12:54:31 -0400 Subject: [PATCH] ensure window exists for universal rendering --- src/react/LogMonitor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/react/LogMonitor.js b/src/react/LogMonitor.js index 99691c9b..d710dcc4 100644 --- a/src/react/LogMonitor.js +++ b/src/react/LogMonitor.js @@ -3,7 +3,9 @@ import LogMonitorEntry from './LogMonitorEntry'; export default class LogMonitor { constructor() { - window.addEventListener('keydown', ::this.handleKeyPress); + if (typeof window !== 'undefined') { + window.addEventListener('keydown', ::this.handleKeyPress); + } } static propTypes = {