Merge pull request #26 from gissehel/robustkey

The code was not robust anymore in weird cases where file['k']=='', it is now.
This commit is contained in:
Richard O'Dwyer 2013-04-27 16:45:15 -07:00
commit fc96c963e4

View file

@ -106,7 +106,7 @@ class Mega(object):
Process a file Process a file
""" """
if file['t'] == 0 or file['t'] == 1: if file['t'] == 0 or file['t'] == 1:
keys = dict(keypart.split(':', 1) for keypart in file['k'].split('/')) keys = dict(keypart.split(':', 1) for keypart in file['k'].split('/') if ':' in keypart)
uid = file['u'] uid = file['u']
key = None key = None
# my objects # my objects