From 388d9484861df4ec517777b042cbcf3723715438 Mon Sep 17 00:00:00 2001 From: "Charles J. Cliffe" Date: Fri, 30 Oct 2015 19:29:56 -0400 Subject: [PATCH] Prevent crash from disabling AGC before device is known --- src/AppFrame.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/AppFrame.cpp b/src/AppFrame.cpp index f918d78..9af3afe 100644 --- a/src/AppFrame.cpp +++ b/src/AppFrame.cpp @@ -508,6 +508,10 @@ void AppFrame::OnMenu(wxCommandEvent& event) { wxGetApp().saveConfig(); iqSwapMenuItem->Check(swap_state); } else if (event.GetId() == wxID_AGC_CONTROL) { + if (wxGetApp().getDevice() == NULL) { + agcMenuItem->Check(); + return; + } if (!wxGetApp().getAGCMode()) { wxGetApp().setAGCMode(true); gainSpacerItem->Show(false);