Fix missing check for ChromeVoxState.instance before use

If enableSpeechLogging is changed to true by default,
this routine is called before ChromeVoxState.instance is
initialized.  Adding a check to prevent the exception.

Bug: None
Test: Manual
Change-Id: I41af3fb914d13a60ec6b8a256faa626ff6444bd1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1651037
Reviewed-by: Alice Boxhall <aboxhall@chromium.org>
Commit-Queue: Randy Rossi <rmrossi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#669333}
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/log_store.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/log_store.js
index 230cfbbe..20f9dff 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/log_store.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/log_store.js
@@ -217,7 +217,7 @@
 /** @private @return {boolean} */
 LogStore.prototype.shouldSkipOutput_ = function() {
   var ChromeVoxState = chrome.extension.getBackgroundPage()['ChromeVoxState'];
-  if (ChromeVoxState.instance.currentRange &&
+  if (ChromeVoxState.instance && ChromeVoxState.instance.currentRange &&
       ChromeVoxState.instance.currentRange.start &&
       ChromeVoxState.instance.currentRange.start.node &&
       ChromeVoxState.instance.currentRange.start.node.root) {