fix: Fixes UOClient NPE (#952)

This commit is contained in:
Kamron Batman 2022-02-28 17:24:00 -08:00 committed by GitHub
parent 5a43c806fe
commit 1f4162288e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -46,20 +46,21 @@ public static class UOClient
{
if (ServerClientVersion == null)
{
logger.Warning("Could not detect client version.");
logger.Warning("Could not detect client version. This may cause data files to load improperly.");
return;
}
else if (CuoSettings.ClientVersion == ServerClientVersion)
if (_automaticallyDetected)
{
logger.Information($"Automatically detected client version {ServerClientVersion} from CUO settings.");
}
else if (_automaticallyDetected)
{
logger.Information($"Automatically detected client version {ServerClientVersion}");
}
else
{
logger.Information($"Manually configured to use client version {ServerClientVersion}");
logger.Information(
CuoSettings?.ClientVersion == ServerClientVersion
? $"Automatically detected client version {ServerClientVersion} from CUO settings."
: $"Automatically detected client version {ServerClientVersion}"
);
return;
}
logger.Information($"Manually configured to use client version {ServerClientVersion}");
}
private static ClientVersion DetectCUOClient()