diff options
| author | Peter Penz <[email protected]> | 2012-04-27 09:28:00 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-04-27 09:31:57 +0200 |
| commit | 0a00f13bf246d37182dafcd053776048f63d2299 (patch) | |
| tree | acd5655d939c413960b20d037d8da89037a756ab /src/views/versioncontrol/versioncontrolobserver.cpp | |
| parent | d1c5dc52a3ac4f83262d00d37a61f6bfb52d5bf4 (diff) | |
Never pass null-items to version-control-plugins
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
Diffstat (limited to 'src/views/versioncontrol/versioncontrolobserver.cpp')
| -rw-r--r-- | src/views/versioncontrol/versioncontrolobserver.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/views/versioncontrol/versioncontrolobserver.cpp b/src/views/versioncontrol/versioncontrolobserver.cpp index bbabd2e4e..42e00de42 100644 --- a/src/views/versioncontrol/versioncontrolobserver.cpp +++ b/src/views/versioncontrol/versioncontrolobserver.cpp @@ -90,7 +90,17 @@ KFileItemModel* VersionControlObserver::model() const 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; } |
