fix(cli): avoid crash if not name is given in uri

This commit is contained in:
Ronan Abhamon 2018-10-04 17:11:22 +02:00
parent 7f1a767fd2
commit 55c1776667

View file

@ -372,7 +372,12 @@ void Cli::executeCommand (const QString &command, CommandFormat *format) {
*format = UriFormat;
// Execute uri command.
qInfo() << QStringLiteral("Execute uri command: `%1`.").arg(command);
qInfo() << QStringLiteral("Execute uri command: `%1`...").arg(command);
if (address->getUsername().empty()) {
qWarning() << QStringLiteral("Failed to execute command. No username given.");
return;
}
string scheme = address->getScheme();
for (const string &validScheme : { "sip", "sip-linphone", "sips", "sips-linphone" })