on xenial help sign in
try to catch a crash in case we're getting bad indexes
1a62160Michael Zanetti
plugins/Unity/Launcher/appdrawermodel.cpp+4
@@ -43,6 +43,10 @@ int AppDrawerModel::rowCount(const QModelIndex &parent) const
43
43
44QVariant AppDrawerModel::data(const QModelIndex &index, int role) const
44QVariant AppDrawerModel::data(const QModelIndex &index, int role) const
45{
45{
46+ if (!index.isValid() || m_list.count() <= index.row()) {
47+ return QVariant();
48+ }
49+
46 switch (role) {
50 switch (role) {
47 case RoleAppId:
51 case RoleAppId:
48 return m_list.at(index.row())->appId();
52 return m_list.at(index.row())->appId();