use prim ctor and fixed warnings: LauncherCallbacks, LauncherController

This commit is contained in:
CWX
2025-01-18 13:34:00 +00:00
parent d7031c53f1
commit b23735bb94
2 changed files with 10 additions and 21 deletions
+4 -4
View File
@@ -99,16 +99,16 @@ public class LauncherController
return result;
}
public Info? Find(string sessionId)
public Info? Find(string? sessionId)
{
return _saveServer.GetProfiles().TryGetValue(sessionId, out var profile) ? profile.ProfileInfo : null;
return sessionId is not null && _saveServer.GetProfiles().TryGetValue(sessionId, out var profile) ? profile.ProfileInfo : null;
}
public string? Login(LoginRequestData info)
public string? Login(LoginRequestData? info)
{
foreach (var kvp in _saveServer.GetProfiles()) {
var account = _saveServer.GetProfile(kvp.Key).ProfileInfo;
if (info.Username == account.Username) {
if (info?.Username == account?.Username) {
return kvp.Key;
}
}