$OpenBSD: patch-src_SideBarModel_cpp,v 1.1 2011/03/30 14:00:48 dcoppa Exp $
--- src/SideBarModel.cpp.orig	Wed Mar 30 12:53:01 2011
+++ src/SideBarModel.cpp	Wed Mar 30 13:01:25 2011
@@ -236,6 +236,8 @@ SideBarModel::data( const QModelIndex &index, int role
 Qt::ItemFlags
 SideBarModel::flags( const QModelIndex& index ) const
 {
+    if ( !index.isValid() )
+        return 0;
     SideBarItem i( index, m_masterList );
     Qt::ItemFlags flags = Qt::ItemIsEnabled | Qt::ItemIsDropEnabled;
 
@@ -652,7 +654,7 @@ SideBarModel::onAvatarDownloaded( QByteArray const buf
     {
         if ( username.toLower() == The::currentUsername().toLower() )
         {
-            #ifdef LINUX
+            #ifdef Q_WS_X11
             int m = 38;
             #else
             int m = 30;
@@ -859,7 +861,7 @@ SideBarItem::SideBarItem( const QModelIndex& i, const 
         }
     }
  
-    if( m_type == TypeUnknown )
+    if( m_type == TypeUnknown && i.isValid() )
         m_type = m_masterList[ i.row() ];
 
 //////
