Commit c42c4107 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: avoid a crash in preferences, on Windows

parent 8d59ba01
...@@ -433,8 +433,11 @@ void StringListConfigControl::finish(module_config_t *p_module_config ) ...@@ -433,8 +433,11 @@ void StringListConfigControl::finish(module_config_t *p_module_config )
char **values, **texts; char **values, **texts;
ssize_t count = config_GetPszChoices( p_this, p_item->psz_name, ssize_t count = config_GetPszChoices( p_this, p_item->psz_name,
&values, &texts ); &values, &texts );
for( ssize_t i = 0; i < count; i++ ) for( ssize_t i = 0; i < count && texts; i++ )
{ {
if( texts[i] == NULL || values[i] == NULL )
continue;
combo->addItem( qfu(texts[i]), QVariant( qfu(values[i])) ); combo->addItem( qfu(texts[i]), QVariant( qfu(values[i])) );
if( !strcmp( p_item->value.psz ? p_item->value.psz : "", values[i] ) ) if( !strcmp( p_item->value.psz ? p_item->value.psz : "", values[i] ) )
combo->setCurrentIndex( combo->count() - 1 ); combo->setCurrentIndex( combo->count() - 1 );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment