mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +00:00
Fix crash calling openDirectories() in various cases
This can cause a crash when called with a single url and split view, or
when the last URL is not shown, because the iterator gets mutated in
the loop, so we need to make sure it hasn't gone out of bounds. This
check was erroneously removed in 1755380208
and needs to be brought back.
This commit is contained in:
parent
38e83eacf8
commit
b9139c5e1c
|
@ -210,7 +210,7 @@ void DolphinTabWidget::openDirectories(const QList<QUrl>& dirs, bool splitView)
|
|||
// Required for updateViewState() call in openFiles() to work as expected
|
||||
// If there is a selection, updateViewState() calls are effectively a no-op
|
||||
tabPage->activeViewContainer()->view()->clearSelection();
|
||||
} else if (splitView) {
|
||||
} else if (splitView && (it != dirs.constEnd())) {
|
||||
const QUrl& secondaryUrl = *(it++);
|
||||
if (somethingWasAlreadyOpen) {
|
||||
openNewTab(primaryUrl, secondaryUrl);
|
||||
|
|
Loading…
Reference in a new issue