Skip to content

Commit

Permalink
Don't crash on null edit
Browse files Browse the repository at this point in the history
Null edits won't include 'newtimestamp' in the response
  • Loading branch information
danmichaelo committed Sep 4, 2014
1 parent 88e3080 commit bd7bc3b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mwclient/page.py
Expand Up @@ -202,7 +202,9 @@ def do_edit():
self.handle_edit_error(e, summary)

if result['edit'].get('result') == 'Success':
self.last_rev_time = client.parse_timestamp(result['edit'].get('newtimestamp'))
lrt = result['edit'].get('newtimestamp')
if lrt: # It's not included if no change was made
self.last_rev_time = client.parse_timestamp(lrt)
return result['edit']

def handle_edit_error(self, e, summary):
Expand Down

0 comments on commit bd7bc3b

Please sign in to comment.