Commits

Mark Egan-Fuller committed 9261c85

Added a length check on error messages.
This avoids any "IndexError: list index out of range" when an empty list is returned.

  • Participants
  • Parent commits a52c6d4

Comments (0)

Files changed (1)

File jira/exceptions.py

                 elif 'errorMessages' in response:
                     # JIRA 5.0.x error messages sometimes come wrapped in this array
                     errorMessages = response['errorMessages']
-                    if isinstance(errorMessages, (list, tuple)):
+                    if isinstance(errorMessages, (list, tuple)) and len(errorMessages) > 0:
                         error = errorMessages[0]
                     else:
                         error = errorMessages