Commit b9139c5e authored by Nate Graham's avatar Nate Graham 💤
Browse files

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 17553802
and needs to be brought back.
parent 38e83eac
Pipeline #56142 passed with stage
in 7 minutes and 18 seconds
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment