diff options
| author | Nate Graham <[email protected]> | 2021-03-30 13:30:27 -0600 |
|---|---|---|
| committer | Nate Graham <[email protected]> | 2021-03-31 09:19:33 -0600 |
| commit | b9139c5e1c4ccdaad5876da6005f6ac1000ee694 (patch) | |
| tree | 0647e1fe2a28f113ce2d42938f5059a6c83aceaf /src/dolphintabwidget.cpp | |
| parent | 38e83eacf820141944a8f91553103afd31b63676 (diff) | |
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 175538020824355115cd98637ce83ecc53badd44
and needs to be brought back.
Diffstat (limited to 'src/dolphintabwidget.cpp')
| -rw-r--r-- | src/dolphintabwidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dolphintabwidget.cpp b/src/dolphintabwidget.cpp index 17fa0ff4e..0a024235b 100644 --- a/src/dolphintabwidget.cpp +++ b/src/dolphintabwidget.cpp @@ -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); |
