Skip to content

Commit

Permalink
Merge branch 'main' into feat/sm-string
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelOsborne committed Jun 25, 2024
2 parents 2108bf1 + 5ee7034 commit a8067d6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions dotlottie-rs/src/dotlottie_player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1145,8 +1145,10 @@ impl DotLottiePlayerContainer {
}

pub fn manifest_string(&self) -> String {
self.runtime.read().unwrap().manifest().unwrap().to_string()
}
self.runtime.try_read().ok()
.and_then(|runtime| runtime.manifest())
.map_or_else(String::new, |manifest| manifest.to_string())
}

pub fn is_complete(&self) -> bool {
self.runtime.read().unwrap().is_complete()
Expand Down Expand Up @@ -1752,7 +1754,7 @@ impl DotLottiePlayer {
}

pub fn manifest_string(&self) -> String {
self.player.read().unwrap().manifest_string()
self.player.try_read().map_or_else(|_| String::new(), |player| player.manifest_string())
}

pub fn is_complete(&self) -> bool {
Expand Down

0 comments on commit a8067d6

Please sign in to comment.