infocalypse
 
(Steve Dougherty)
2013-07-25: Fix crash on no VCS messages.

Fix crash on no VCS messages.

diff --git a/infocalypse/wot.py b/infocalypse/wot.py
--- a/infocalypse/wot.py
+++ b/infocalypse/wot.py
@@ -15,6 +15,7 @@ import threading
 
 FREEMAIL_SMTP_PORT = 4025
 FREEMAIL_IMAP_PORT = 4143
+# TODO: Is whitespace in the search key illegal?
 VCS_TOKEN = "[vcs] "
 PLUGIN_NAME = "org.freenetproject.plugin.infocalypse_webui.main.InfocalypsePlugin"
 
@@ -163,6 +164,11 @@ def check_notifications(ui, sent_to_iden
     # imaplib returns numbers in a singleton string separated by whitespace.
     message_numbers = message_numbers[0].split()
 
+    if not message_numbers:
+        # TODO: Is aborting appropriate here? Should this be ui.status and
+        # return?
+        raise util.Abort("No notifications found.")
+
     # fetch() expects strings for both. Individual message numbers are
     # separated by commas. It seems desirable to peek because it's not yet
     # apparent that this is a [vcs] message with YAML.