From bc9e4f52b4cf6b3d7bffc683e92efb01a25e8821 Mon Sep 17 00:00:00 2001 From: James Magahern Date: Tue, 20 Dec 2022 16:43:45 -0800 Subject: [PATCH] PreviewURL is nil on old macOS for some reason --- kordophone/Bridge/Operations/MBIMFetchAttachmentOperation.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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]);