Move nullptr check to modefilter

merge-requests/6/head
Phil Taylor 2021-06-26 10:58:54 +01:00
rodzic c25040f793
commit 19f33d1ed7
1 zmienionych plików z 8 dodań i 7 usunięć

Wyświetl plik

@ -2233,11 +2233,6 @@ void wfmain::doCmd(commandtype cmddata)
std::shared_ptr<void> data = cmddata.data;
// This switch is for commands with parameters.
// the "default" for non-parameter commands is to call doCmd(cmd).
if (data == nullptr)
{
qInfo(logSystem()) << __PRETTY_FUNCTION__ << "WARNING: data is null";
return;
}
switch (cmd)
{
@ -2255,8 +2250,14 @@ void wfmain::doCmd(commandtype cmddata)
}
case cmdSetModeFilter:
{
mode_info m = (*std::static_pointer_cast<mode_info>(data));
emit setMode(m);
if (data == nullptr)
{
qInfo(logSystem()) << __PRETTY_FUNCTION__ << "WARNING: data is null";
}
else {
mode_info m = (*std::static_pointer_cast<mode_info>(data));
emit setMode(m);
}
break;
}
case cmdSetTxPower: