From 67f158298175936767387191cb5d548c5a980055 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Wed, 2 Jan 2013 20:07:15 -0500 Subject: fix abort on set-profile after removing profile ponymix set-profile off ponymix set-profile output:stereo-da+input:stereo-analog --- ponymix.cc | 4 ++++ 1 file changed, 4 insertions(+) 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); -- cgit v1.2.3