File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,15 @@ export async function move(
26
26
if ( dst . windowId === NOID ) return
27
27
}
28
28
29
+ // Check if target panel exists
30
+ if ( dst . panelId ) {
31
+ const dstPanel = Sidebar . panelsById [ dst . panelId ]
32
+ if ( ! Utils . isTabsPanel ( dstPanel ) ) {
33
+ Logs . warn ( 'Tabs.move: wrong type of target panel:' , Utils . clone ( dstPanel ) )
34
+ return
35
+ }
36
+ }
37
+
29
38
// Move tabs from another window to this window
30
39
if ( src . windowId !== undefined && src . windowId !== Windows . id ) {
31
40
const tabIds = tabsInfo . map ( t => t . id )
@@ -86,7 +95,7 @@ export async function move(
86
95
}
87
96
88
97
// Gather tabs by type (pinned/normal), get initial info
89
- const dstTab : Tab | undefined = Tabs . list [ dst . index ]
98
+ const dstTab = Tabs . list [ dst . index ] as Tab | undefined
90
99
const dstParent = Tabs . byId [ dst . parentId ]
91
100
const pinnedTabs : Tab [ ] = [ ]
92
101
const normalTabs : Tab [ ] = [ ]
@@ -103,6 +112,7 @@ export async function move(
103
112
tabs . push ( tab )
104
113
}
105
114
115
+ if ( dstTab ?. pinned && ! dst . pinned ) return
106
116
if ( ! tabs . length ) return
107
117
108
118
// Switch panelId of pinned tabs and exclude them from general list
You can’t perform that action at this time.
0 commit comments