plasma5-workspace/0001-dont-crash-if-we-don-t-have-a-launcherTasksModel.patch

29 lines
1.0 KiB
Diff

From 3d506f00979bedbc68d5253db22e7fa0bfdbb45e Mon Sep 17 00:00:00 2001
From: David Edmundson <kde@davidedmundson.co.uk>
Date: Tue, 30 May 2017 16:31:50 +0100
Subject: [PATCH] dont' crash if we don't have a launcherTasksModel
If we don't have a launcher tasks model it's obvious no item can match
an item in the launcher tasks model.
---
libtaskmanager/tasksmodel.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libtaskmanager/tasksmodel.cpp b/libtaskmanager/tasksmodel.cpp
index 3d791ae5..83ef8b5b 100644
--- a/libtaskmanager/tasksmodel.cpp
+++ b/libtaskmanager/tasksmodel.cpp
@@ -921,6 +921,9 @@ QVariant TasksModel::data(const QModelIndex &proxyIndex, int role) const
if (proxyIndex.data(AbstractTasksModel::IsLauncher).toBool()) {
return true;
} else {
+ if (!d->launcherTasksModel) {
+ return false;
+ }
for (int i = 0; i < d->launcherTasksModel->rowCount(); ++i) {
const QModelIndex &launcherIndex = d->launcherTasksModel->index(i, 0);
--
2.13.0