Fixes crash when attempting to use invalid clipboard image when changing game artwork
This commit is contained in:
parent
a371bb71a9
commit
5939e20399
@ -526,17 +526,15 @@ extension GameCollectionViewController: ImportControllerDelegate
|
|||||||
{
|
{
|
||||||
let imageData = try Data(contentsOf: url)
|
let imageData = try Data(contentsOf: url)
|
||||||
|
|
||||||
if let image = UIImage(data: imageData)
|
if
|
||||||
|
let image = UIImage(data: imageData),
|
||||||
|
let resizedImage = image.resizing(toFit: CGSize(width: 300, height: 300)),
|
||||||
|
let resizedData = UIImageJPEGRepresentation(resizedImage, 0.85)
|
||||||
{
|
{
|
||||||
let resizedImage = image.resizing(toFit: CGSize(width: 300, height: 300))
|
let destinationURL = DatabaseManager.artworkURL(for: game)
|
||||||
|
try resizedData.write(to: destinationURL, options: .atomic)
|
||||||
|
|
||||||
if let resizedData = UIImageJPEGRepresentation(resizedImage, 0.85)
|
imageURL = destinationURL
|
||||||
{
|
|
||||||
let destinationURL = DatabaseManager.artworkURL(for: game)
|
|
||||||
try resizedData.write(to: destinationURL, options: .atomic)
|
|
||||||
|
|
||||||
imageURL = destinationURL
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|||||||
2
External/Roxas
vendored
2
External/Roxas
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 902035729a2d93099f07d63af2f77f6e326ebfec
|
Subproject commit 97b3a7ab05ee320d3c96eadc3cc69c38d10ec206
|
||||||
Loading…
Reference in New Issue
Block a user