try to catch a crash in case we're getting bad indexes
commit1a6216062040d49ed9e3be541b206142297a9e16
authorMichael Zanetti <michael.zanetti@canonical.com>
dateMon 23 Jan 2017, 16:55 (10 years ago)
parentc67bb6a
plugins/Unity/Launcher/appdrawermodel.cpp+4
@@ -43,6 +43,10 @@ int AppDrawerModel::rowCount(const QModelIndex &parent) const
4343
4444QVariant AppDrawerModel::data(const QModelIndex &index, int role) const
4545{
46+ if (!index.isValid() || m_list.count() <= index.row()) {
47+ return QVariant();
48+ }
49+
4650 switch (role) {
4751 case RoleAppId:
4852 return m_list.at(index.row())->appId();