mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-04-04 21:17:43 +03:00
Prevent crash when all entries are deleted from a group
* Fix #4093 - The first entry in the list is selected after deleting an entry * Prevents crashes due to dangling pointers held by the Entry Preview Widget when entries were deleted. * Improve GUI tests to ensure this new behavior occurs.
This commit is contained in:
parent
6cde2b83e8
commit
0d3eb047c7
4 changed files with 31 additions and 4 deletions
|
@ -145,10 +145,12 @@ void EntryPreviewWidget::setDatabaseMode(DatabaseWidget::Mode mode)
|
|||
}
|
||||
|
||||
if (mode == DatabaseWidget::Mode::ViewMode) {
|
||||
if (m_ui->stackedWidget->currentWidget() == m_ui->pageGroup) {
|
||||
if (m_currentGroup && m_ui->stackedWidget->currentWidget() == m_ui->pageGroup) {
|
||||
setGroup(m_currentGroup);
|
||||
} else {
|
||||
} else if (m_currentEntry) {
|
||||
setEntry(m_currentEntry);
|
||||
} else {
|
||||
hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue