Commit e6f59ee9 authored by Felix Paul Kühne's avatar Felix Paul Kühne

App Delegate: prevent crash if added media is being removed while it didn't fully arrive

parent a1200ef7
......@@ -135,6 +135,9 @@
NSNumber *prevFetchedSize = [_addedFiles objectForKey:fileURL];
NSNumber *updatedSize = [attribs objectForKey:NSFileSize];
if (!updatedSize || updatedSize.intValue == 0)
continue;
if ([prevFetchedSize compare:updatedSize] == NSOrderedSame) {
[_addedFiles removeObjectForKey:fileURL];
[[MLMediaLibrary sharedMediaLibrary] addFilePaths:@[fileURL]];
......@@ -197,7 +200,6 @@
_addMediaTimer = [NSTimer scheduledTimerWithTimeInterval:2. target:self
selector:@selector(addFileTimerFired)
userInfo:nil repeats:YES];
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment