avito-tech / Paparazzo

Custom iOS camera and photo picker with editing capabilities
MIT License
779 stars 82 forks source link

Remove assert upon empty image directory path #78

Closed ignatovv closed 5 years ago

ignatovv commented 5 years ago

Got assertion in my unit tests when trying to delete empty library. I think is should not treated as assert and fail the tests. Add check for emptiness before deletion.

Error Domain=NSCocoaErrorDomain Code=4 "Не удалось удалить «Paparazzo»." 
UserInfo={NSFilePath=/Users/ios-build/Library/Developer/CoreSimulator/Devices/36CC2858-9FFD-4833-9DEA-DF56EB07345A/data/Containers/Data/Application/02501A27-A017-49CE-85A7-90C22BA8A908/tmp/Paparazzo,
NSUnderlyingError=0x6000010525a0 {
Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}:
file /Pods/Paparazzo/Paparazzo/Core/Helpers/ImageStorage.swift, line 77