Skip to content

Commit

Permalink
Added null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphiMC committed Nov 13, 2023
1 parent 97014f8 commit 4211d88
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public FullBedrockSession applyStep(final HttpClient httpClient, final StepMCCha

@Override
protected FullBedrockSession fromDeduplicatedJson(final JsonObject json) {
final StepMCChain.MCChain mcChain = this.prevStep.fromJson(json.getAsJsonObject("mcChain"));
final StepPlayFabToken.PlayFabToken playFabToken = this.prevStep2.fromJson(json.getAsJsonObject("playFabToken"));
final StepMCChain.MCChain mcChain = this.prevStep != null ? this.prevStep.fromJson(json.getAsJsonObject("mcChain")) : null;
final StepPlayFabToken.PlayFabToken playFabToken = this.prevStep2 != null ? this.prevStep2.fromJson(json.getAsJsonObject("playFabToken")) : null;
return new FullBedrockSession(mcChain, playFabToken);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public FullJavaSession applyStep(final HttpClient httpClient, final StepMCProfil

@Override
protected FullJavaSession fromDeduplicatedJson(final JsonObject json) {
final StepMCProfile.MCProfile mcProfile = this.prevStep.fromJson(json.getAsJsonObject("mcProfile"));
final StepPlayerCertificates.PlayerCertificates playerCertificates = this.prevStep2.fromJson(json.getAsJsonObject("playerCertificates"));
final StepMCProfile.MCProfile mcProfile = this.prevStep != null ? this.prevStep.fromJson(json.getAsJsonObject("mcProfile")) : null;
final StepPlayerCertificates.PlayerCertificates playerCertificates = this.prevStep2 != null ? this.prevStep2.fromJson(json.getAsJsonObject("playerCertificates")) : null;
return new FullJavaSession(mcProfile, playerCertificates);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public FullXblSession applyStep(final HttpClient httpClient, final StepXblUserTo

@Override
protected FullXblSession fromDeduplicatedJson(final JsonObject json) {
final StepXblUserToken.XblUserToken xblUserToken = this.prevStep.fromJson(json.getAsJsonObject("xblUserToken"));
final StepXblUserToken.XblUserToken xblUserToken = this.prevStep != null ? this.prevStep.fromJson(json.getAsJsonObject("xblUserToken")) : null;
final StepXblTitleToken.XblTitleToken xblTitleToken = this.prevStep2 != null ? this.prevStep2.fromJson(json.getAsJsonObject("xblTitleToken")) : null;
return new FullXblSession(xblUserToken, xblTitleToken);
}
Expand Down

0 comments on commit 4211d88

Please sign in to comment.