Commits

mickael9 committed c3d5d91

Fix invalid fileid causing an unhandled exception

  • Participants
  • Parent commits 225ace7

Comments (0)

Files changed (1)

File gett_uploader.py

             share = user.get_share(match.group(1))
 
             if match.group(2):
-                id = match.group(2)
-                file = share.files[id]
-                file.destroy()
+                try:
+                    id = match.group(2)
+                    file = share.files[id]
+                    file.destroy()
 
-                print('Deleted file %s [%s]' % (file.name, file.url))
+                    print('Deleted file %s [%s]' % (file.name, file.url))
+                except KeyError:
+                    print("No such file in the share")
             else:
                 print('Deleted share %s' % share.name)
                 share.destroy()