Merge pull request #19881 from khairul169/popupmenu_animedit

Fix error msg when selecting popupmenu if there is no animation selected
This commit is contained in:
Max Hilbrunner 2018-07-03 18:44:48 +02:00 committed by GitHub
commit 27b20e7670
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1103,9 +1103,12 @@ void AnimationPlayerEditor::_animation_about_to_show_menu() {
void AnimationPlayerEditor::_animation_tool_menu(int p_option) {
String current = animation->get_item_text(animation->get_selected());
String current;
if (animation->get_selected() >= 0 && animation->get_selected() < animation->get_item_count())
current = animation->get_item_text(animation->get_selected());
Ref<Animation> anim;
if (current != "") {
if (current != String()) {
anim = player->get_animation(current);
}