this should fix crashes in the nick/bufer view delegates when receiving an invalid...
[quassel.git] / src / uisupport / bufferview.cpp
index 0d7be09..345fd7b 100644 (file)
@@ -509,6 +509,9 @@ bool BufferViewDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, c
 void BufferViewDelegate::initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const {
   QStyledItemDelegate::initStyleOption(option, index);
 
+  if(!index.isValid())
+    return;
+
   BufferInfo::ActivityLevel activity = (BufferInfo::ActivityLevel)index.data(NetworkModel::BufferActivityRole).toInt();
 
   QColor fgColor = _FgColorNoActivity;