handle clicking in the main window when no rspec downloaded
authorsmbaker <smbaker@fc8clean.lan>
Tue, 24 Jan 2012 00:25:41 +0000 (16:25 -0800)
committersmbaker <smbaker@fc8clean.lan>
Tue, 24 Jan 2012 00:25:41 +0000 (16:25 -0800)
sface/screens/mainscreen.py

index 988d608..df110c6 100644 (file)
@@ -75,6 +75,11 @@ class NodeView(QTreeView):
     def toggleSelection(self):
         index = self.currentIndex()
         model = index.model()
     def toggleSelection(self):
         index = self.currentIndex()
         model = index.model()
+
+        if (model == None):
+            # probably no rspec downloaded yet
+            return
+
         status_index = model.index(index.row(), MEMBERSHIP_STATUS_COLUMN, index.parent())
         status_data = status_index.data().toString()
         node_index = model.index(index.row(), NAME_COLUMN, index.parent())
         status_index = model.index(index.row(), MEMBERSHIP_STATUS_COLUMN, index.parent())
         status_data = status_index.data().toString()
         node_index = model.index(index.row(), NAME_COLUMN, index.parent())
@@ -125,6 +130,11 @@ class NodeView(QTreeView):
         # Right click
         index = self.currentIndex()
         model = index.model()
         # Right click
         index = self.currentIndex()
         model = index.model()
+
+        if (model == None):
+            # probably no rspec downloaded yet
+            return
+
         status_index = model.index(index.row(), 1, index.parent())
         status_data = status_index.data().toString()
         node_index = model.index(index.row(), 0, index.parent())
         status_index = model.index(index.row(), 1, index.parent())
         status_data = status_index.data().toString()
         node_index = model.index(index.row(), 0, index.parent())