Browse Source

MediaCells: Replace fatalError by assertionFailure

Avoid crashing the app in the worst case.
Soomin Lee 5 years ago
parent
commit
5faa917b84

+ 1 - 1
Sources/MediaCategoryCells/MediaCollectionViewCell.swift

@@ -35,7 +35,7 @@ class MediaCollectionViewCell: BaseCollectionViewCell {
             } else if let genre = media as? VLCMLGenre {
                 update(genre: genre)
             } else {
-                fatalError("needs to be of Type VLCMLMedia or VLCMLAlbum")
+                assertionFailure("MovieCollectionViewCell: media: Needs to be of a supported Type.")
             }
         }
     }

+ 1 - 1
Sources/MediaCategoryCells/MovieCollectionViewCell.swift

@@ -35,7 +35,7 @@ class MovieCollectionViewCell: BaseCollectionViewCell {
             } else if let playlist = media as? VLCMLPlaylist {
                 update(playlist:playlist)
             } else {
-                fatalError("wrong object")
+                assertionFailure("MovieCollectionViewCell: media: Needs to be of a supported Type.")
             }
         }
     }

+ 1 - 1
Sources/MediaEditCell.swift

@@ -38,7 +38,7 @@ class MediaEditCell: BaseCollectionViewCell {
             } else if let audio = media as? VLCMLMedia, audio.type() == .audio {
                 updateForAudio(audio: audio)
             } else {
-                fatalError("needs to be of a supported Type")
+                assertionFailure("MediaEditCell: media: Needs to be of a supported Type.")
             }
         }
     }