Skip to content

Commit

Permalink
This fixes #271
Browse files Browse the repository at this point in the history
  • Loading branch information
ldx committed Oct 16, 2019
1 parent a26a630 commit c4dced4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion iptc/ip4tc.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ def get_all_parameters(self):
res = shlex.split(buf)
res.reverse()
inv = False
key = None
while len(res) > 0:
x = res.pop()
if x == '!':
Expand All @@ -433,7 +434,11 @@ def get_all_parameters(self):
params[key] = []
inv = False
continue
params[key].append(x) # This is a parameter value.
# At this point key should be set, unless the output from save is
# not formatted right. Let's be defensive, since some users
# reported that problem.
if key is not None:
params[key].append(x) # This is a parameter value.
return params

def _update_parameters(self):
Expand Down

0 comments on commit c4dced4

Please sign in to comment.