File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -500,15 +500,17 @@ +(void) deleteFileForMessage:(MLMessage*) msg
500500{
501501 if (![msg.messageType isEqualToString: kMessageTypeFiletransfer ])
502502 return ;
503- DDLogInfo (@" Deleting file for url %@ " , msg.messageText );
504503 MLFiletransferInfo* info = msg.fileInfo ;
505- DDLogDebug (@" Deleting file in cache: %@ " , info.cacheFilePath );
506- [_fileManager removeItemAtPath: info.cacheFilePath error: nil ];
504+ if (info.downloadState < DownloadStateComplete)
505+ return ;
506+ DDLogInfo (@" Deleting file for url %@ " , msg.messageText );
507507 if ([info.mimeType hasPrefix: @" video/" ])
508508 {
509509 DDLogVerbose (@" Deleting video thumbnail stored at %@ " , msg.fileInfo .thumbnailURL .path );
510510 [_fileManager removeItemAtPath: msg.fileInfo.thumbnailURL.path error: nil ];
511511 }
512+ DDLogDebug (@" Deleting file in cache: %@ " , info.cacheFilePath );
513+ [_fileManager removeItemAtPath: info.cacheFilePath error: nil ];
512514}
513515
514516+(MLHandler*) prepareDataUpload : (NSData *) data
You can’t perform that action at this time.
0 commit comments