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

[stable-3.14] Fix crash caused due to null accountstate in FileProviderSocketController #7332

Merged
merged 1 commit into from
Oct 17, 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
14 changes: 13 additions & 1 deletion src/gui/macOS/fileprovidersocketcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,19 @@ void FileProviderSocketController::parseReceivedLine(const QString &receivedLine
const auto argument = receivedLine.mid(argPos + 1);

if (command == QStringLiteral("FILE_PROVIDER_DOMAIN_IDENTIFIER_REQUEST_REPLY")) {
_accountState = FileProviderDomainManager::accountStateFromFileProviderDomainIdentifier(argument);
auto domainIdentifier = argument;
// Check if we have a port number who's colon has been replaced by a hyphen
// This is a workaround for the fact that we can't use colons as characters in domain names
// Let's check if, after the final hyphen, we have a number -- then it is a port number
const auto portColonPos = argument.lastIndexOf('-');
const auto possiblePort = argument.mid(portColonPos + 1);
auto validInt = false;
const auto port = possiblePort.toInt(&validInt);
if (validInt && port > 0) {
domainIdentifier.replace(portColonPos, 1, ':');
}

_accountState = FileProviderDomainManager::accountStateFromFileProviderDomainIdentifier(domainIdentifier);
sendAccountDetails();
reportSyncState("SYNC_PREPARING");
return;
Expand Down
Loading