Commit f431b93e authored by Nate Graham's avatar Nate Graham
Browse files

[kmainwindow] Don't delete entries from an invalid kconfiggroup

If for some reason the config group we're trying to delete entries from
doesn't exist, the app will assert in KConfigGroup::deleteEntry in
`Q_ASSERT_X(isValid(), "KConfigGroup::deleteEntry", "accessing an
invalid group");`

So let's guard against that by only deleting the entry from the config
group if the group itself is valid. Maybe it's not, for some reason.

BUG: 427236
FIXED-IN: 5.75
parent ab43b986
...@@ -537,7 +537,9 @@ void KMainWindow::closeEvent(QCloseEvent *e) ...@@ -537,7 +537,9 @@ void KMainWindow::closeEvent(QCloseEvent *e)
} }
// Delete the marker that says we don't want to restore the position of the // Delete the marker that says we don't want to restore the position of the
// next-opened instance; now that a window is closing, we do want to do this // next-opened instance; now that a window is closing, we do want to do this
if (d->autoSaveGroup.isValid()) {
d->autoSaveGroup.deleteEntry("RestorePositionForNextInstance"); d->autoSaveGroup.deleteEntry("RestorePositionForNextInstance");
}
d->_k_slotSaveAutoSavePosition(); d->_k_slotSaveAutoSavePosition();
if (queryClose()) { if (queryClose()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment