Some plugins are not prepared for this and might crash. Although
the additional check in VersionControlObserver::actions() should not
be necessary because of the fix in DolphinView, it is left here
to catch potential other cases where a null-item might get passed
accidently.
Thanks to Ilya for initially patching the Box-plugin which gave
a hint whats going wrong.
BUG: 294336
FIXED-IN: 4.9.0
if (items.isEmpty()) {
const KFileItem item = m_model->rootItem();
- actions = m_versionControlObserver->actions(KFileItemList() << item);
+ if (!item.isNull()) {
+ actions = m_versionControlObserver->actions(KFileItemList() << item);
+ }
} else {
actions = m_versionControlObserver->actions(items);
}
QList<QAction*> VersionControlObserver::actions(const KFileItemList& items) const
{
QList<QAction*> actions;
- if (!m_model) {
+
+ bool hasNullItems = false;
+ foreach (const KFileItem& item, items) {
+ if (item.isNull()) {
+ kWarning() << "Requesting version-control-actions for empty items";
+ hasNullItems = true;
+ break;
+ }
+ }
+
+ if (!m_model || hasNullItems) {
return actions;
}