Private
Public Access
1
0

PreviewURL is nil on old macOS for some reason

This commit is contained in:
James Magahern
2022-12-20 16:43:45 -08:00
parent 3082c4ab19
commit bc9e4f52b4

View File

@@ -76,10 +76,13 @@
break; break;
} }
// Convert to JPEG.
responseData = MBIMCGImageJPEGRepresentation(previewImage); responseData = MBIMCGImageJPEGRepresentation(previewImage);
// Persist JPEG preview to disk // Persist JPEG preview to disk
[responseData writeToURL:previewURL atomically:YES]; if (previewURL) {
[responseData writeToURL:previewURL atomically:YES];
}
} else { } else {
// File exists // File exists
MBIMLogInfo(@"Using cached preview image for guid: %@ at %@", guid, [previewURL path]); MBIMLogInfo(@"Using cached preview image for guid: %@ at %@", guid, [previewURL path]);