Fix #786 by checking for opts in the bindings

This commit is contained in:
EJ 2016-04-17 09:30:54 +02:00 committed by Soeren Apel
parent 1f706c21a2
commit 116670b15d
1 changed files with 5 additions and 3 deletions

View File

@ -434,9 +434,11 @@ set<const ConfigKey *> Driver::scan_options() const
{
GArray *opts = sr_driver_scan_options_list(_structure);
set<const ConfigKey *> result;
for (guint i = 0; i < opts->len; i++)
result.insert(ConfigKey::get(g_array_index(opts, uint32_t, i)));
g_array_free(opts, TRUE);
if (opts) {
for (guint i = 0; i < opts->len; i++)
result.insert(ConfigKey::get(g_array_index(opts, uint32_t, i)));
g_array_free(opts, TRUE);
}
return result;
}