Skip to content

Commit

Permalink
Add null check for world
Browse files Browse the repository at this point in the history
  • Loading branch information
zax71 committed Mar 8, 2024
1 parent 1a508a5 commit 6982d8e
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ void onSpawnTpCommand(
) {

Check warning on line 51 in src/main/java/org/mvplugins/multiverse/core/commands/SpawnCommand.java

View workflow job for this annotation

GitHub Actions / checkstyle / checkstyle

[checkstyle] reported by reviewdog 🐶 'method def rparen' has incorrect indentation level 11, expected level should be 4. Raw Output: /github/workspace/./src/main/java/org/mvplugins/multiverse/core/commands/SpawnCommand.java:51:12: warning: 'method def rparen' has incorrect indentation level 11, expected level should be 4. (com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck)

Check warning on line 51 in src/main/java/org/mvplugins/multiverse/core/commands/SpawnCommand.java

View workflow job for this annotation

GitHub Actions / checkstyle / checkstyle

[checkstyle] reported by reviewdog 🐶 ')' should be on the previous line. Raw Output: /github/workspace/./src/main/java/org/mvplugins/multiverse/core/commands/SpawnCommand.java:51:12: warning: ')' should be on the previous line. (SeparatorWrapEol)
// The player is in the world, so it must be loaded
LoadedMultiverseWorld world = worldManager.getLoadedWorld(player.getWorld().getName()).getOrNull();
if (world == null) {
issuer.sendMessage("The world the player you are trying to teleport is in, is not a multiverse world");
}

// TODO: Log when the player cannot be teleported there. No clue how to detect that

Check warning on line 58 in src/main/java/org/mvplugins/multiverse/core/commands/SpawnCommand.java

View workflow job for this annotation

GitHub Actions / checkstyle / checkstyle

[checkstyle] reported by reviewdog 🐶 Comment matches to-do format 'TODO'. Raw Output: /github/workspace/./src/main/java/org/mvplugins/multiverse/core/commands/SpawnCommand.java:58:11: info: Comment matches to-do format 'TODO'. (com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck)
// Teleport the player
Expand Down

0 comments on commit 6982d8e

Please sign in to comment.