Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaBs committed Nov 7, 2021
1 parent 73c440f commit ee9e794
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CmlLib/Core/Auth/Microsoft/XboxMinecraftLogin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public AuthenticationResponse LoginWithXbox(string uhs, string xstsToken)
var res = req.GetResponse();
var resBody = readRes(res);

var obj = JsonConvert.DeserializeObject<AuthenticationResponse>(resBody);
var obj = JsonConvert.DeserializeObject<AuthenticationResponse>(resBody)
?? new AuthenticationResponse();
obj.ExpiresOn = DateTime.Now.AddSeconds(obj.ExpiresIn);
return obj;
}
Expand Down
1 change: 0 additions & 1 deletion CmlLib/Core/Launcher/MLaunch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Diagnostics;
using System.IO;
using System.Linq;
using CmlLib.Core.Auth;
using CmlLib.Core.Version;

namespace CmlLib.Core
Expand Down
4 changes: 1 addition & 3 deletions CmlLib/Core/Launcher/MNative.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Diagnostics;
using CmlLib.Core.Version;
using CmlLib.Core.Version;
using CmlLib.Utils;
using System.IO;

Expand Down
2 changes: 1 addition & 1 deletion CmlLib/Core/MojangLauncher/MojangLauncherAccounts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static MojangLauncherAccounts FromFile(string path)
return FromJSON(content);
}

public static MojangLauncherAccounts FromJSON(string json)
public static MojangLauncherAccounts? FromJSON(string json)
{
return JsonConvert.DeserializeObject<MojangLauncherAccounts>(json);
}
Expand Down

0 comments on commit ee9e794

Please sign in to comment.