Fix a crash on 10.12 and earlier.

This commit is contained in:
Damiano Galassi committed 2019-09-15 15:25:28 +02:00
1 parent 879bf33c2b
commit 8de2581285
8 files changed
+125 -91

No files matched your search

+6 -1
View File
@@ -260,7 +260,12 @@ final class ArtworkSelectorController: NSViewController, NSCollectionViewDataSou
let range = (artworks.count - endIndex ..< artworks.count)
let indexes = range.map { IndexPath(item: $0, section: 0)}
imageBrowser.insertItems(at: Set(indexes))
if #available(OSX 10.13, *) {
imageBrowser.insertItems(at: Set(indexes))
} else {
// Call this on 10.12 and 10.11 to avoid a crash
imageBrowser.reloadData()
}
}
private func selectArtwork(type: ArtworkType, service: String) {