diff --git a/src/DOUAudioFileProvider.m b/src/DOUAudioFileProvider.m index 097a9b5..960df94 100644 --- a/src/DOUAudioFileProvider.m +++ b/src/DOUAudioFileProvider.m @@ -293,7 +293,13 @@ - (void)_requestDidReceiveResponse ofItemAtPath:_cachedPath error:NULL]; #endif /* TARGET_OS_IPHONE */ - [[NSFileHandle fileHandleForWritingAtPath:_cachedPath] truncateFileAtOffset:_expectedLength]; + @try { + [[NSFileHandle fileHandleForWritingAtPath:_cachedPath] truncateFileAtOffset:_expectedLength]; + } + @catch (NSException *exception) { + _failed = YES; + NSLog(@"%@", exception.debugDescription); + } _mimeType = [[_request responseHeaders] objectForKey:@"Content-Type"];