From 0ea10b74553a33905b865ff55111c76170e111dc Mon Sep 17 00:00:00 2001 From: Sven Mueller Date: Tue, 28 Apr 2026 08:50:04 +0200 Subject: [PATCH] mediakeys.go example: Fix error handling. The panic re-uses the `err` variable defined in line 11 and at this point guaranteed to be nil - instead of using the call.Err just checked by the if. This change fixes that problem. --- _examples/mediakeys.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_examples/mediakeys.go b/_examples/mediakeys.go index 5ee296fc..98a32ed5 100644 --- a/_examples/mediakeys.go +++ b/_examples/mediakeys.go @@ -26,7 +26,7 @@ func main() { bus := conn.Object("org.gnome.SettingsDaemon", "/org/gnome/SettingsDaemon/MediaKeys") call := bus.Call("org.gnome.SettingsDaemon.MediaKeys.GrabMediaPlayerKeys", 0, "test app", uint(0)) if call.Err != nil { - panic(err) + panic(call.Err) } signals := make(chan *dbus.Signal, 10)