summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2020-04-05 13:19:22 +0200
committerDave Davenport <qball@gmpclient.org>2020-04-05 13:19:22 +0200
commit825fe4ae58e169f92ce940b672054e9fbdefb1ad (patch)
treeab4f36c98b5b107913c2e7fa8c23750c8ebd984c
parentbacecf3044be0dea3f8c5e06a2354443f09152eb (diff)
[Script] Fix crash when custom input with custom keybinding.
-rw-r--r--source/dialogs/script.c6
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 ) {