mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Check for invalid indexes in Module selection
This should fix crashes when moving with pressed mouse buttons on category nods
This commit is contained in:
parent
56a3a90955
commit
c227a4af41
@ -324,6 +324,9 @@ void ModuleSelectionManager::updateAddPB()
|
||||
}
|
||||
|
||||
QModelIndex const & idx = availableLV->selectionModel()->currentIndex();
|
||||
|
||||
if (!idx.isValid())
|
||||
return;
|
||||
|
||||
if (getAvailableModel()->itemFromIndex(idx)->hasChildren()) {
|
||||
// This is a category header
|
||||
@ -3337,6 +3340,9 @@ void GuiDocument::updateModuleInfo()
|
||||
}
|
||||
QModelIndex const & idx = lv->selectionModel()->currentIndex();
|
||||
|
||||
if (!idx.isValid())
|
||||
return;
|
||||
|
||||
if (!focus_on_selected
|
||||
&& modules_av_model_.itemFromIndex(idx)->hasChildren()) {
|
||||
// This is a category header
|
||||
|
Loading…
Reference in New Issue
Block a user