Skip to main content

Handle the case where a tab doesn’t have a URL

ID
3887710
date
2024-05-17 09:26:44+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
ffea0e9
message
Handle the case where a tab doesn't have a URL
changed files
1 file, 3 additions, 1 deletion

Changed files

macos/close_specific_tabs (1546) → macos/close_specific_tabs (1588)

diff --git a/macos/close_specific_tabs b/macos/close_specific_tabs
index c476159..9f94c54 100755
--- a/macos/close_specific_tabs
+++ b/macos/close_specific_tabs
@@ -23,7 +23,9 @@ function* tabGenerator() {
     for (tab_index = tab_count - 1; tab_index >= 0; tab_index--) {
       tab = window.tabs[tab_index];
 
-      yield [window_index, tab_index, tab.url(), tab.name()];
+      if (tab.url() !== null) {
+        yield [window_index, tab_index, tab.url(), tab.name()];
+      }
     }
   }
 }