Fix sonar cloud bugs

This commit is contained in:
tastybento 2021-03-07 11:15:09 -08:00
parent c26b27afa1
commit 462c27f2df
2 changed files with 5 additions and 3 deletions

View File

@ -241,7 +241,9 @@ public class ChallengesImportManager
this.addon.logWarning("challenges.messages.defaults-file-overwrite"); this.addon.logWarning("challenges.messages.defaults-file-overwrite");
} }
defaultFile.delete(); if (!defaultFile.delete()) {
this.addon.logError("Could not delete file: " + defaultFile.getAbsolutePath());
}
} }
else else
{ {

View File

@ -262,7 +262,7 @@ public class ChallengesManager
* @param silent - if true, no messages are sent to user * @param silent - if true, no messages are sent to user
* @return - true if imported * @return - true if imported
*/ */
public boolean loadChallenge(@NonNull Challenge challenge, public boolean loadChallenge(@Nullable Challenge challenge,
boolean overwrite, boolean overwrite,
User user, User user,
boolean silent) boolean silent)
@ -346,7 +346,7 @@ public class ChallengesManager
* @param silent of type boolean that indicate if message to user must be sent. * @param silent of type boolean that indicate if message to user must be sent.
* @return boolean that indicate about load status. * @return boolean that indicate about load status.
*/ */
public boolean loadLevel(@NonNull ChallengeLevel level, public boolean loadLevel(@Nullable ChallengeLevel level,
boolean overwrite, boolean overwrite,
User user, User user,
boolean silent) boolean silent)