Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

udp_server: fix crash when dialog opens for the first time #1002

Merged
merged 1 commit into from
Nov 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion plotjuggler_plugins/DataStreamUDP/udp_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,13 @@ bool UDP_Server::start(QStringList*)

// load previous values
QSettings settings;
QString protocol = settings.value("UDP_Server::protocol", "JSON").toString();
QString address_str = settings.value("UDP_Server::address", "127.0.0.1").toString();
int port = settings.value("UDP_Server::port", 9870).toInt();
QString protocol = settings.value("UDP_Server::protocol").toString();
if (parserFactories()->find(protocol) == parserFactories()->end())
{
protocol = "json";
}

dialog.ui->lineEditAddress->setText(address_str);
dialog.ui->lineEditPort->setText(QString::number(port));
Expand Down