tdf#143342: fix crash when using "Search Command" feature
Error: attempt to subscript container with out-of-bounds index -1, but container only holds 0 elements. Objects involved in the operation: sequence "this" @ 0x0x85b1d50 { type = std::__debug::vector<CurrentEntry, std::allocator<CurrentEntry> >; } 4 0x00007fe75d569357 in CommandListBox::RowActivated(weld::TreeView&) (this=0x85b1d30) at sfx2/source/commandpopup/CommandPopup.cxx:202 5 0x00007fe75d569649 in CommandListBox::TreeViewKeyPress(KeyEvent const&) (this=0x85b1d30, rKeyEvent=...) at sfx2/source/commandpopup/CommandPopup.cxx:222 6 0x00007fe75d569170 in CommandListBox::LinkStubTreeViewKeyPress(void*, KeyEvent const&) (instance=0x85b1d30, data=...) at sfx2/source/commandpopup/CommandPopup.cxx:209 Change-Id: I62923ce106da62e3d7d7572536f5e065773683ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118891 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
This commit is contained in:
parent
2575f97571
commit
32b820b7ac
1 changed files with 1 additions and 1 deletions
|
@ -197,7 +197,7 @@ IMPL_LINK_NOARG(CommandListBox, RowActivated, weld::TreeView&, bool)
|
|||
{
|
||||
OUString aCommandURL;
|
||||
int nSelected = mpCommandTreeView->get_selected_index();
|
||||
if (nSelected < int(maCommandList.size()))
|
||||
if (nSelected != -1 && nSelected < int(maCommandList.size()))
|
||||
{
|
||||
auto const& rCurrent = maCommandList[nSelected];
|
||||
aCommandURL = rCurrent.m_aCommandURL;
|
||||
|
|
Loading…
Reference in a new issue