diff options
author | Dave Davenport <qball@gmpclient.org> | 2020-04-05 13:19:22 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2020-04-05 13:19:22 +0200 |
commit | 825fe4ae58e169f92ce940b672054e9fbdefb1ad (patch) | |
tree | ab4f36c98b5b107913c2e7fa8c23750c8ebd984c | |
parent | bacecf3044be0dea3f8c5e06a2354443f09152eb (diff) |
[Script] Fix crash when custom input with custom keybinding.
-rw-r--r-- | source/dialogs/script.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/dialogs/script.c b/source/dialogs/script.c index 65d86bfb..db5e6c96 100644 --- a/source/dialogs/script.c +++ b/source/dialogs/script.c @@ -268,7 +268,11 @@ static ModeMode script_mode_result ( Mode *sw, int mretv, char **input, unsigned else if ( ( mretv & MENU_QUICK_SWITCH ) ) { //retv = 1+( mretv & MENU_LOWER_MASK ); script_mode_reset_highlight ( sw ); - new_list = execute_executor ( sw, rmpd->cmd_list[selected_line].entry, &new_length,10+( mretv & MENU_LOWER_MASK ) ); + if ( selected_line != UINT32_MAX ) { + new_list = execute_executor ( sw, rmpd->cmd_list[selected_line].entry, &new_length,10+( mretv & MENU_LOWER_MASK ) ); + } else { + new_list = execute_executor ( sw, *input, &new_length,10+( mretv & MENU_LOWER_MASK ) ); + } } else if ( ( mretv & MENU_OK ) && rmpd->cmd_list[selected_line].entry != NULL ) { if ( rmpd->cmd_list[selected_line].nonselectable ) { |