mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-07 14:38:03 +02:00
scripts: common-utils: do not crash if the defaults table is nil
Fixes #542, #544
This commit is contained in:
parent
b58c94816a
commit
c0b212bb0e
1 changed files with 9 additions and 7 deletions
|
|
@ -168,14 +168,16 @@ function cutils.get_config_section (name, defaults)
|
|||
section = defaults or {}
|
||||
else
|
||||
section = section:parse ()
|
||||
for k, v in pairs (defaults) do
|
||||
if section [k] == nil then
|
||||
section [k] = v
|
||||
if defaults then
|
||||
for k, v in pairs (defaults) do
|
||||
if section [k] == nil then
|
||||
section [k] = v
|
||||
end
|
||||
end
|
||||
end
|
||||
for k, v in ipairs (defaults) do
|
||||
if section [k] == nil then
|
||||
section [k] = v
|
||||
for k, v in ipairs (defaults) do
|
||||
if section [k] == nil then
|
||||
section [k] = v
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue