Skip to content

Commit

Permalink
Fix existing session NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
A5H73Y committed Jan 7, 2023
1 parent 33e4c2d commit fe61f66
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
<dependency>
<groupId>com.github.cryptomorin</groupId>
<artifactId>XSeries</artifactId>
<version>9.1.0</version>
<version>9.2.0</version>
<scope>compile</scope>
</dependency>
<!-- Version Compare -->
Expand All @@ -163,7 +163,7 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10</version>
<version>2.10.1</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public void onPlayerJoin(PlayerJoinEvent event) {

ParkourSession session = parkour.getParkourSessionManager().loadParkourSession(player,
playerConfig.getExistingSessionCourseName());
playerConfig.setExistingSessionCourseName(null);
playerConfig.removeExistingSessionCourseName();

if (!parkour.getParkourSessionManager().isPlaying(player)) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public void saveParkourSession(Player player, boolean removePlaying) {
public ParkourSession loadParkourSession(Player player, String courseName) {
ParkourSession result = null;

if (ParkourSessionConfig.hasParkourSessionConfig(player, courseName)) {
if (courseName != null && ParkourSessionConfig.hasParkourSessionConfig(player, courseName)) {
ParkourSessionConfig config = ParkourSessionConfig.getConfig(player, courseName);

// course is populated by deserializing
Expand Down

0 comments on commit fe61f66

Please sign in to comment.