summaryrefslogtreecommitdiff
diff options
authorJulien Nabet <serval2412@yahoo.fr>2025-04-27 23:19:55 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2025-04-28 11:12:52 +0200
commit1d8253e4f036b187f4eed0548480c639448f604f (patch)
tree3a6f87e4af07a63f0dc9632656d6131b179150eb
parent6b82bff3898486554d7c4bfd54bee79740f54401 (diff)
tdf#166365: Crash in file picker, directory property (kf5/kf6)libreoffice-24-8
See bt from assertion here: https://bugs.documentfoundation.org/show_bug.cgi?id=166365#c1 Let's do the same as Gtk3KDE5FolderPicker::getDirectory() in vcl/unx/gtk3_kde5/gtk3_kde5_folderpicker.cxx Change-Id: Iaea4e4b916c30cc14d3959725922c73e9d161625 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184691 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins (cherry picked from commit e77624db7f223ca1e487cea462e04a73efbc9f2b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184694 (cherry picked from commit 53940f818f720d948b3d857dc9c66bdcbc999872) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184705
-rw-r--r--vcl/qt5/QtFilePicker.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/vcl/qt5/QtFilePicker.cxx b/vcl/qt5/QtFilePicker.cxx
index 3193f9901db5..fc0f879d4b02 100644
--- a/vcl/qt5/QtFilePicker.cxx
+++ b/vcl/qt5/QtFilePicker.cxx
@@ -977,7 +977,7 @@ OUString QtFilePicker::getDirectory()
uno::Sequence<OUString> seq = getSelectedFiles();
if (seq.getLength() > 1)
seq.realloc(1);
- return seq[0];
+ return seq.hasElements() ? seq[0] : OUString();
}
void QtFilePicker::setDescription(const OUString&) {}
close