nicklan / pnmixer

Volume mixer for the system tray
GNU General Public License v3.0
152 stars 32 forks source link

pnmixer crashes if you don't set the three hotkeys when hotkeys are enabled #159

Closed 00cpxxx closed 7 years ago

00cpxxx commented 7 years ago

Hi, thanks for pnmixer. I really enjoy it. I just noticed that after configuring only volume UP and DOWN, leaving the mute unset pnmixer will crash. The small change below solves the problem.

diff --git a/src/hotkey.c b/src/hotkey.c
index 2ac6abe..82193ef 100644
--- a/src/hotkey.c
+++ b/src/hotkey.c
@@ -135,7 +135,7 @@ hotkey_matches(Hotkey *hotkey, guint code, GdkModifierType mods)
 {
        guint i;

-       if (code != hotkey->code)
+       if (!hotkey || code != hotkey->code)
                return FALSE;

        for (i = 0; i < G_N_ELEMENTS(keymasks); i++)
            
elboulangero commented 7 years ago

Nice catch, thanks for that. Fix commited.