Skip to content

Commit

Permalink
Fix sonar cloud bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Mar 7, 2021
1 parent c26b27a commit 462c27f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ public boolean generateDefaultChallengeFile(User user, World world, boolean over
this.addon.logWarning("challenges.messages.defaults-file-overwrite");
}

defaultFile.delete();
if (!defaultFile.delete()) {
this.addon.logError("Could not delete file: " + defaultFile.getAbsolutePath());
}
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ private void loadChallenge(@NonNull Challenge challenge)
* @param silent - if true, no messages are sent to user
* @return - true if imported
*/
public boolean loadChallenge(@NonNull Challenge challenge,
public boolean loadChallenge(@Nullable Challenge challenge,
boolean overwrite,
User user,
boolean silent)
Expand Down Expand Up @@ -346,7 +346,7 @@ private void loadLevel(@NonNull ChallengeLevel level)
* @param silent of type boolean that indicate if message to user must be sent.
* @return boolean that indicate about load status.
*/
public boolean loadLevel(@NonNull ChallengeLevel level,
public boolean loadLevel(@Nullable ChallengeLevel level,
boolean overwrite,
User user,
boolean silent)
Expand Down

0 comments on commit 462c27f

Please sign in to comment.