Prevent fatal that manifests only in some rare cases when uploading files with iOS device