aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);