Prevent crash from disabling AGC before device is known

This commit is contained in:
Charles J. Cliffe 2015-10-30 19:29:56 -04:00
parent 798c558c09
commit 388d948486
1 changed files with 4 additions and 0 deletions

View File

@ -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);