Don't try to save autoconfig profile if device name is empty

This commit is contained in:
twinaphex 2017-01-02 08:11:28 +01:00
parent 03818dc780
commit 095c97d053

View File

@ -1314,6 +1314,7 @@ static int setting_action_ok_bind_all_save_autoconfig(void *data, bool wraparoun
unsigned index_offset;
settings_t *settings = config_get_ptr();
rarch_setting_t *setting = (rarch_setting_t*)data;
const char *name = NULL;
(void)wraparound;
@ -1321,9 +1322,9 @@ static int setting_action_ok_bind_all_save_autoconfig(void *data, bool wraparoun
return -1;
index_offset = setting->index_offset;
name = settings->input.device_names[index_offset];
if(config_save_autoconf_profile(
settings->input.device_names[index_offset], index_offset))
if(!string_is_empty(name) && config_save_autoconf_profile(name, index_offset))
runloop_msg_queue_push(
msg_hash_to_str(MSG_AUTOCONFIG_FILE_SAVED_SUCCESSFULLY), 1, 100, true);
else