diff --git a/kordophone/Bridge/Operations/MBIMFetchAttachmentOperation.m b/kordophone/Bridge/Operations/MBIMFetchAttachmentOperation.m index a21433f..1822d70 100644 --- a/kordophone/Bridge/Operations/MBIMFetchAttachmentOperation.m +++ b/kordophone/Bridge/Operations/MBIMFetchAttachmentOperation.m @@ -76,10 +76,13 @@ break; } + // Convert to JPEG. responseData = MBIMCGImageJPEGRepresentation(previewImage); // Persist JPEG preview to disk - [responseData writeToURL:previewURL atomically:YES]; + if (previewURL) { + [responseData writeToURL:previewURL atomically:YES]; + } } else { // File exists MBIMLogInfo(@"Using cached preview image for guid: %@ at %@", guid, [previewURL path]);