cui/source/dialogs/cuigaldlg.cxx | 5 +++++ 1 file changed, 5 insertions(+)
New commits: commit f974357fdf6d2a208d25c77f3e7769edb26756fe Author: Caolán McNamara <[email protected]> AuthorDate: Sun Dec 21 20:08:07 2025 +0000 Commit: Xisco Fauli <[email protected]> CommitDate: Mon Dec 22 13:05:01 2025 +0100 cid#1676290 Argument cannot be negative Change-Id: I849b6ad05383f6296d853f3748dab92d2cd41f76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196050 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins (cherry picked from commit f2508099ee3a1fb3d2335cd59ecf57efe6c79c77) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196083 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx index 77345d17526f..f85b76eab9cf 100644 --- a/cui/source/dialogs/cuigaldlg.cxx +++ b/cui/source/dialogs/cuigaldlg.cxx @@ -868,6 +868,11 @@ IMPL_LINK_NOARG(TPGalleryThemeProperties, ClickPreviewHdl, weld::Toggleable&, vo void TPGalleryThemeProperties::DoPreview() { int nIndex = m_xLbxFound->get_selected_index(); + if (nIndex == -1) + { + SAL_WARN("cui.dialogs", "Nothing selected"); + return; + } OUString aString(m_xLbxFound->get_text(nIndex)); if (aString == aPreviewString)
