lua/pod: don't crash on parsing objects with unknown keys, just ignore them

This commit is contained in:
George Kiagiadakis
2021-03-01 17:57:32 +02:00
parent 9f50117fa7
commit 5b4fe3cd85

View File

@@ -1048,9 +1048,11 @@ push_luapod (lua_State *L, WpSpaPod *pod, WpSpaIdValue field_idval)
//FIXME: this is suboptimal because _get_property() converts
// the key to a short name and we convert it back
wp_spa_pod_get_property (prop, &key, &val);
push_luapod (L, val,
wp_spa_id_table_find_value_from_short_name (values_table, key));
lua_setfield (L, -2, key);
if (key) {
push_luapod (L, val,
wp_spa_id_table_find_value_from_short_name (values_table, key));
lua_setfield (L, -2, key);
}
}
lua_setfield (L, -2, "properties");
}