From f8d6f53a24f2f6cf953cc9e4c26edf4dbbca6031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Silkeb=C3=A6kken?= Date: Mon, 28 Jan 2013 14:06:19 +0100 Subject: [PATCH] Don't check for mail if username or password is missing --- powerline/segments/common.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/powerline/segments/common.py b/powerline/segments/common.py index 4183853a..e27d5985 100644 --- a/powerline/segments/common.py +++ b/powerline/segments/common.py @@ -236,6 +236,8 @@ def email_imap_alert(username, password, server='imap.gmail.com', port=993, fold import imaplib import re + if not username or not password: + return None try: mail = imaplib.IMAP4_SSL(server, port) mail.login(username, password)