Skip to content

Commit

Permalink
Do not create DotLottieImageProvider instance if there's no image f…
Browse files Browse the repository at this point in the history
…iles (#2271)
  • Loading branch information
hardworker authored Jan 3, 2024
1 parent 9c1e7f1 commit af18de2
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/Private/Model/DotLottie/DotLottieImageProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ class DotLottieImageProvider: AnimationImageProvider {
///
/// - Parameter filepath: The absolute filepath containing the images.
///
init(filepath: String) {
self.filepath = URL(fileURLWithPath: filepath)
loadImages()
convenience init?(filepath: String) {
self.init(filepath: URL(fileURLWithPath: filepath))
}

init(filepath: URL) {
init?(filepath: URL) {
guard filepath.urls.count > 0 else { return nil }
self.filepath = filepath
loadImages()
}
Expand Down
Binary file added Tests/Samples/Issues/pr_2271.lottie
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Supports Core Animation engine
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit af18de2

Please sign in to comment.