Noticed that if debug is enabled ask_for_optional is a required field and will break without it being set
diff --git a/flask_openid.py b/flask_openid.py
index b66ca20..6909d6a 100644
--- a/flask_openid.py
+++ b/flask_openid.py
@@ -515,9 +515,10 @@
             for key in ask_for:
                 if key not in ALL_KEYS:
                     raise ValueError('invalid key %r' % key)
-            for key in ask_for_optional:
-                if key not in ALL_KEYS:
-                    raise ValueError('invalid optional key %r' % key)
+            if ask_for_optional:
+                for key in ask_for_optional:
+                    if key not in ALL_KEYS:
+                        raise ValueError('invalid optional key %r' % key)
         try:
             consumer = Consumer(SessionWrapper(self), self.store_factory())
             auth_request = consumer.begin(identity_url)