diff options
author | Dave Reisner <dreisner@archlinux.org> | 2013-01-02 20:07:15 -0500 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2013-01-02 20:07:21 -0500 |
commit | 67f158298175936767387191cb5d548c5a980055 (patch) | |
tree | e82ad5469b75e89268932ddba9604eabda372d09 | |
parent | acbd81fc241a400325a4e47a3f09d2f4f4d9f0d2 (diff) | |
download | mirror-ponymix-67f158298175936767387191cb5d548c5a980055.tar.gz mirror-ponymix-67f158298175936767387191cb5d548c5a980055.tar.bz2 mirror-ponymix-67f158298175936767387191cb5d548c5a980055.zip |
fix abort on set-profile after removing profile
ponymix set-profile off
ponymix set-profile output:stereo-da+input:stereo-analog
<kaboom>
-rw-r--r-- | ponymix.cc | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -281,6 +281,8 @@ static int SetDefault(PulseClient& ponymix, int, char*[]) { } static int GetProfile(PulseClient& ponymix, int, char*[]) { + if (opt_card == nullptr) errx(1, "error: no card selected"); + auto card = ponymix.GetCard(opt_card); if (card == nullptr) errx(1, "error: no match found for card: %s", opt_card); @@ -290,6 +292,8 @@ static int GetProfile(PulseClient& ponymix, int, char*[]) { } static int SetProfile(PulseClient& ponymix, int, char* argv[]) { + if (opt_card == nullptr) errx(1, "error: no card selected"); + auto card = ponymix.GetCard(opt_card); if (card == nullptr) errx(1, "error: no match found for card: %s", opt_card); |