Skip to content

Commit

Permalink
fix(safeConsole): check if document is defined to avoid issues in nod…
Browse files Browse the repository at this point in the history
…e environments
  • Loading branch information
Rafael Fernandez Serra authored and mergify[bot] committed Jan 6, 2020
1 parent 244effb commit da29d88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/safeConsole.ts
Expand Up @@ -22,7 +22,7 @@ function fallbackConsole(console) {

function getSafeConsole() {
// @ts-ignore
const isIE9 = document && document.documentMode && document.documentMode === 9;
const isIE9 = typeof document !== 'undefined' && document.documentMode && document.documentMode === 9;
if (isIE9) {
return window && window.console ? ie9Console(window.console) : noopConsoleStub;
} else if (!console.table || !console.error) {
Expand Down

0 comments on commit da29d88

Please sign in to comment.