win can sometimes be null (not sure how?)

This commit is contained in:
Jeremy Kauffman 2017-10-13 16:33:37 -04:00
parent d1c09ad71c
commit eeec63a27e

View file

@ -132,7 +132,7 @@ reducers[types.DOWNLOADING_COMPLETED] = function(state, action) {
const badgeNumber = state.badgeNumber;
// Don't update the badge number if the window is focused
if (win.isFocused()) return Object.assign({}, state);
if (win && win.isFocused()) return Object.assign({}, state);
return Object.assign({}, state, {
badgeNumber: badgeNumber + 1,