mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-04 16:38:14 +02:00
lua: json: catch syntax errors when converting to native lua types
and most importantly, push nil on the stack, so that there is something returned from this function... the caller always expects a value to be pushed
This commit is contained in:
parent
8912dc25c3
commit
70980fe355
1 changed files with 7 additions and 0 deletions
|
|
@ -165,6 +165,13 @@ push_luajson (lua_State *L, WpSpaJson *json)
|
|||
lua_setfield (L, -2, key_str);
|
||||
}
|
||||
}
|
||||
|
||||
/* syntax error */
|
||||
else {
|
||||
g_autofree gchar *value = wp_spa_json_parse_string (json);
|
||||
wp_warning ("unknown SPA JSON token type at '%s'", value);
|
||||
lua_pushnil (L);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue