Prevent crash when updating file provider domains if the account for which a file provider domain was configured no longer exists

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-06-25 18:52:31 +08:00
parent 07d5e40ade
commit fc2e687c3d

View file

@ -458,8 +458,9 @@ void FileProviderDomainManager::updateFileProviderDomains()
continue;
}
const auto accountState = AccountManager::instance()->accountFromUserId(accountUserIdAtHost);
addFileProviderDomainForAccount(accountState.data());
if (const auto accountState = AccountManager::instance()->accountFromUserId(accountUserIdAtHost)) {
addFileProviderDomainForAccount(accountState.data());
}
}
for (const auto &remainingDomainUserId : configuredDomains) {