mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
Guard against possible referencing null.
Those checks might not be needed, but it's not self obvious from
the surrounding code. Because we already experienced crash from
similar change (cf 1c1c83eced
), let's be prudent here.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg216414.html
This commit is contained in:
parent
1c1c83eced
commit
cad91ec1bc
@ -159,7 +159,8 @@ void BulletsModule::selectItem(int font, int character, bool select)
|
||||
return;
|
||||
|
||||
QListWidget * lw = static_cast<QListWidget *>(bulletpaneSW->widget(font));
|
||||
lw->item(character)->setSelected(select);
|
||||
if (lw && lw->item(character))
|
||||
lw->item(character)->setSelected(select);
|
||||
}
|
||||
|
||||
|
||||
|
@ -3448,7 +3448,8 @@ void PrefShortcuts::shortcutOkPressed()
|
||||
if (item) {
|
||||
user_bind_.bind(&k, func);
|
||||
shortcutsTW->sortItems(0, Qt::AscendingOrder);
|
||||
item->parent()->setExpanded(true);
|
||||
if (item->parent())
|
||||
item->parent()->setExpanded(true);
|
||||
shortcutsTW->setCurrentItem(item);
|
||||
shortcutsTW->scrollToItem(item);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user