From c08ec94ae04656e5178a704445080fe6887aac5a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 11 Feb 2021 15:27:08 +0000 Subject: ignore row-activated with no active cursor position MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit to reproduce: under gen launch base wizard, "open an existing database file", and use the "open" button, double click a .odb. base launches on the 2nd button down, on mouse *release* base has appeared and has a treeview under the mouse which gets button up and triggers "onSelected" with the unexpected no-row selected case https: //crashreport.libreoffice.org/stats/crash_details/a6282ff5-d0aa-4beb-9b44-6c5fd2ca0130 Change-Id: Ic4a5fa9fc8c9c6bb0e33c165559eda966b83e3ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110768 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- dbaccess/source/ui/app/AppDetailView.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'dbaccess') diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx index 8570db552fe1..eba80dbfb4ec 100644 --- a/dbaccess/source/ui/app/AppDetailView.cxx +++ b/dbaccess/source/ui/app/AppDetailView.cxx @@ -70,11 +70,12 @@ void OTasksWindow::updateHelpText() IMPL_LINK(OTasksWindow, onSelected, weld::TreeView&, rTreeView, bool) { m_nCursorIndex = rTreeView.get_cursor_index(); - assert(m_nCursorIndex != -1 && "OTasksWindow::onSelected: invalid entry!"); - URL aCommand; - aCommand.Complete = reinterpret_cast(rTreeView.get_id(m_nCursorIndex).toUInt64())->sUNOCommand; - getDetailView()->getBorderWin().getView()->getAppController().executeChecked( aCommand, Sequence< PropertyValue >() ); - + if (m_nCursorIndex != -1) + { + URL aCommand; + aCommand.Complete = reinterpret_cast(rTreeView.get_id(m_nCursorIndex).toUInt64())->sUNOCommand; + getDetailView()->getBorderWin().getView()->getAppController().executeChecked( aCommand, Sequence< PropertyValue >() ); + } return true; } -- cgit