summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-09-19 20:32:05 +0200
committerGitHub <noreply@github.com>2019-09-19 20:32:05 +0200
commit2add51d0823fe2ef7cb439a6f3fae17e8dd4717f (patch)
treea91c6beea8e3de36bc7e912514f95e0000e76bdc /editor/plugins
parentc3d5c964941cc8ed4c1b4ba796e2cb990feb0442 (diff)
parentb01d07e0496397697c904db71d58f248c30d1123 (diff)
Merge pull request #31964 from nekomatata/fix-animation-player-error
Fixed switching back to AnimationPlayerEditor with empty animation list
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index 0991832eff..d7451849a1 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -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();
+ }
}
}
}