Skip to content

KFilePlaceEditDialog: Fix crash when editing the "Trash" places entry in Dolphin

Jan Paul Batrina requested to merge work/fix-places-trace-edit-location into master

When the original item's url is trash:/, m_iconButton wasn't instantiated since isIconEditable() will return false. If the url is edited to point somewhere else, isIconEditable() will return false, making the check in KFilePlaceEditDialog::icon() fail to guard access to m_iconButton which points to nullptr. This crash can be seen by trying to change the "Trash" entry's location in Dolphin's Places panel.

This patch makes it so that m_iconButton is always instantiated to prevent the crash and also to always preserve the original icon before editing.

BUG: 439622

Edited by Jan Paul Batrina

Merge request reports

Loading