Make 'send' action safe when there are no ID requests
authorSam Thursfield <samthursfield@codethink.co.uk>
Wed, 15 Jun 2011 10:32:59 +0000 (11:32 +0100)
committerSam Thursfield <samthursfield@codethink.co.uk>
Wed, 15 Jun 2011 10:32:59 +0000 (11:32 +0100)
src/moonshot-window.vala

index c9244a5..d5de70f 100644 (file)
@@ -351,6 +351,8 @@ class MainWindow : Window
 
     public void send_identity_cb (IdCardWidget id_card_widget)
     {
+        return_if_fail (request_queue.length > 0);
+
         var request = this.request_queue.pop_head ();
         var identity = id_card_widget.id_card;
         this.selected_id_card_widget = id_card_widget;