Moved console existence check before the variable is used.  This was causing a crash in Internet Explorer when the console was not enabled (console is off by default).
Merge pull request #1336 from poscar/ie_console_fix

Fixed IE crash related to console usage. (Fix #1321)