diff options
| author | mrmr1993 | 2014-09-25 11:25:49 +0100 |
|---|---|---|
| committer | mrmr1993 | 2014-10-25 23:31:19 +0100 |
| commit | bc042d344d69c9378251ab98561dc29ee552279b (patch) | |
| tree | f24a8753c40e849efd9b1a7503939bc875b845fb | |
| parent | cddda15f232e007f934318b3d90948507eed9db0 (diff) | |
| download | vimium-bc042d344d69c9378251ab98561dc29ee552279b.tar.bz2 | |
Fail gracefully in restoreTab when runtime.lastError is set
This brings behaviour of the chrome.sessions codepath in line with the
legacy code.
| -rw-r--r-- | background_scripts/main.coffee | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 352cfa48..562be033 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -250,7 +250,8 @@ BackgroundCommands = restoreTab: (callback) -> # TODO: remove if-else -block when adopted into stable if chrome.sessions - chrome.sessions.restore(null, (restoredSession) -> callback()) + chrome.sessions.restore(null, (restoredSession) -> + callback() unless chrome.runtime.lastError) else # TODO(ilya): Should this be getLastFocused instead? chrome.windows.getCurrent((window) -> |
