aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2013-01-02 20:07:15 -0500
committerDave Reisner <dreisner@archlinux.org>2013-01-02 20:07:21 -0500
commit67f158298175936767387191cb5d548c5a980055 (patch)
treee82ad5469b75e89268932ddba9604eabda372d09
parentacbd81fc241a400325a4e47a3f09d2f4f4d9f0d2 (diff)
downloadmirror-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.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/ponymix.cc b/ponymix.cc
index 74ffc75..ab287da 100644
--- a/ponymix.cc
+++ b/ponymix.cc
@@ -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);