Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from andrewkrug/bug_indexing_zero
Browse files Browse the repository at this point in the history
resolve attemtping to index first item in list
  • Loading branch information
andrewkrug authored Aug 21, 2017
2 parents ba67abd + 25b515e commit 5c244f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/oic/oauth2/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def to_dict(self, lev=0):

if isinstance(val, Message):
_res[key] = val.to_dict(lev + 1)
elif isinstance(val, list) and isinstance(val[0], Message):
elif isinstance(val, list) and isinstance(next(iter(val or []), None), Message):
_res[key] = [v.to_dict(lev) for v in val]
else:
_res[key] = val
Expand Down

0 comments on commit 5c244f5

Please sign in to comment.