Skip to content

Commit

Permalink
Merge pull request #31964 from nekomatata/fix-animation-player-error
Browse files Browse the repository at this point in the history
Fixed switching back to AnimationPlayerEditor with empty animation list
  • Loading branch information
akien-mga authored Sep 19, 2019
2 parents c3d5c96 + b01d07e commit 2add51d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions editor/plugins/animation_player_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,10 @@ void AnimationPlayerEditor::set_state(const Dictionary &p_state) {

if (p_state.has("animation")) {
String anim = p_state["animation"];
_select_anim_by_name(anim);
_animation_edit();
if (!anim.empty() && player->has_animation(anim)) {
_select_anim_by_name(anim);
_animation_edit();
}
}
}
}
Expand Down

0 comments on commit 2add51d

Please sign in to comment.