Skip to content

Commit

Permalink
Fix NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
TechnicallyCoded committed Mar 11, 2024
1 parent 271d576 commit d4a572c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,8 @@ public CompletableFuture<Boolean> teleportAsync(Player player, Location location
@Override
public WrappedTask wrapTask(Object nativeTask) {
if (!(nativeTask instanceof ScheduledTask)) {
throw new IllegalArgumentException("The nativeTask provided must be a ScheduledTask. Got: " + nativeTask.getClass().getName() + " instead.");
String nativeTaskClassName = nativeTask == null ? null : nativeTask.getClass().getName();
throw new IllegalArgumentException("The nativeTask provided must be a ScheduledTask. Got: " + nativeTaskClassName + " instead.");
}

return new WrappedFoliaTask((ScheduledTask) nativeTask);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ public CompletableFuture<Boolean> teleportAsync(Player player, Location location
@Override
public WrappedTask wrapTask(Object nativeTask) {
if (!(nativeTask instanceof BukkitTask)) {
throw new IllegalArgumentException("The nativeTask provided must be a BukkitTask. Got: " + nativeTask.getClass().getName() + " instead.");
String nativeTaskClassName = nativeTask == null ? null : nativeTask.getClass().getName();
throw new IllegalArgumentException("The nativeTask provided must be a BukkitTask. Got: " + nativeTaskClassName + " instead.");
}

return ImplementationTestsUtil.isCancelledSupported() ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@ public CompletableFuture<Boolean> teleportAsync(Player player, Location location
@Override
public WrappedTask wrapTask(Object nativeTask) {
if (!(nativeTask instanceof BukkitTask)) {
throw new IllegalArgumentException("The nativeTask provided must be a BukkitTask. Got: " + nativeTask.getClass().getName() + " instead.");
String nativeTaskClassName = nativeTask == null ? null : nativeTask.getClass().getName();
throw new IllegalArgumentException("The nativeTask provided must be a BukkitTask. Got: " + nativeTaskClassName + " instead.");
}

return new WrappedBukkitTask((BukkitTask) nativeTask);
Expand Down

0 comments on commit d4a572c

Please sign in to comment.