summaryrefslogtreecommitdiffstats
path: root/network/wirednetworkmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'network/wirednetworkmodel.cpp')
-rw-r--r--network/wirednetworkmodel.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/network/wirednetworkmodel.cpp b/network/wirednetworkmodel.cpp
index d14bce4..eb8988b 100644
--- a/network/wirednetworkmodel.cpp
+++ b/network/wirednetworkmodel.cpp
@@ -9,8 +9,13 @@ WiredNetworkModel::WiredNetworkModel(QObject *parent)
QVariant WiredNetworkModel::data(const QModelIndex &index, int role) const
{
+ QVariant ret;
+
+ if (!index.isValid())
+ return ret;
+
if (index.row() < 0 || index.row() >= m_networks.count())
- return QVariant();
+ return ret;
const ConnectionProfile *network = m_networks[index.row()];
@@ -25,7 +30,7 @@ QVariant WiredNetworkModel::data(const QModelIndex &index, int role) const
return network->state();
}
- return QVariant();
+ return ret;
}
QHash<int, QByteArray> WiredNetworkModel::roleNames() const {