summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-11-20 12:49:47 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-11-20 12:49:47 +0100
commit30d9ad76bd6716ee999476c124e2fc8840b49017 (patch)
treece39570f69c1fb887e133e8fb5e128b1405569e0
parentd00f88f52655e146c953477600d7c64d05fedd2a (diff)
Fix getting current tab ID when there are no tabs
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
-rw-r--r--js/views/tabview.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/js/views/tabview.js b/js/views/tabview.js
index cea087b0c..fe9010cd6 100644
--- a/js/views/tabview.js
+++ b/js/views/tabview.js
@@ -337,9 +337,14 @@
/**
* Returns the ID of the currently selected tab.
*
- * @return {string} the ID of the currently selected tab.
+ * @return {string} the ID of the currently selected tab, or an empty
+ * string if there is none.
*/
getCurrentTabId: function() {
+ if (this._tabHeadersView === null) {
+ return '';
+ }
+
return this._tabHeadersView.getCurrentTabId();
},