fixed crash when changing selection in the animation editor
@@ -795,14 +795,17 @@ impl TrackList {
.try_get(selection.animation_player)
.and_then(|n| n.query_component_ref::<AnimationPlayer>())
{
- if animation_player
- .animations()
- .try_get(selection.animation)
- .is_some()
+ if let Some(animation) =
+ animation_player.animations().try_get(selection.animation)
{
if let Some(track_view_ref) = ui
.node(message.destination())
.query_component::<TrackView>()
+ {
+ if animation
+ .tracks()
+ .iter()
+ .any(|t| t.id() == track_view_ref.id)
{
sender
.send(Message::do_scene_command(SetTrackEnabledCommand {
@@ -819,6 +822,7 @@ impl TrackList {
}
}
}
+ }
pub fn clear(&mut self, ui: &UserInterface) {
ui.send_message(TreeRootMessage::items(
