Make the counter migration safer.

This commit is contained in:
Arik Fraimovich 2015-09-09 09:57:54 +03:00
parent 5de3de12f0
commit 98307aec0d

View File

@ -6,7 +6,7 @@ if __name__ == '__main__':
if vis.type == 'COUNTER':
options = json.loads(vis.options)
print "Before: ", options
if 'rowNumber' in options:
if 'rowNumber' in options and options['rowNumber'] is not None:
options['rowNumber'] += 1
else:
options['rowNumber'] = 1