mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-07 09:58:04 +02:00
scripts/device: avoid crashing if the device.name is not set
This should never happen, but there are odd cases with broken configuration where such a device may appear and the least we can do is not crash, at least not when the device.name is only used for debug messages. In state-profile and other places where the name really matters, we actually have checks in place. Fixes: #674
This commit is contained in:
parent
31806862b0
commit
47ec81408e
2 changed files with 2 additions and 2 deletions
|
|
@ -23,7 +23,7 @@ AsyncEventHook {
|
|||
execute = function (event, transition)
|
||||
local device = event:get_subject ()
|
||||
local profile = event:get_data ("selected-profile")
|
||||
local dev_name = device.properties ["device.name"]
|
||||
local dev_name = device.properties ["device.name"] or ""
|
||||
|
||||
if not profile then
|
||||
log:info (device, "No profile found to set on " .. dev_name)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ SimpleEventHook {
|
|||
end
|
||||
|
||||
local device = event:get_subject ()
|
||||
local dev_name = device.properties["device.name"]
|
||||
local dev_name = device.properties["device.name"] or ""
|
||||
local off_profile = nil
|
||||
local best_profile = nil
|
||||
local unk_profile = nil
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue