Skip to content

Commit

Permalink
libs: Return null if reporter is not configured
Browse files Browse the repository at this point in the history
  • Loading branch information
osipxd committed Aug 23, 2021
1 parent 4ccfa16 commit 580bc68
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ X changes total

## [Unreleased]

### Changes

- This version requires at least Mimic 0.6.1

### Housekeeping

- Dependencies updated? removed unused dependenices
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ private boolean checkMimic() {
} else if (MimicApiLevel.checkApiLevel(MimicApiLevel.VERSION_0_6)) {
return true;
} else {
Log.w("At least Mimic 0.6 required for RPGInventory.");
Log.w("At least Mimic 0.6.1 required for RPGInventory.");
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
* It is part of the RpgInventory.
* All rights reserved 2014 - 2016 © «EndlessCode Group»
*/
@SuppressWarnings("deprecation")
final class RPGInventoryCommandExecutor implements CommandExecutor {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

package ru.endlesscode.rpginventory;

import org.jetbrains.annotations.NotNull;
import ru.endlesscode.inspector.bukkit.plugin.TrackedPlugin;
import ru.endlesscode.inspector.bukkit.report.BukkitEnvironment;
import ru.endlesscode.inspector.report.*;
Expand All @@ -32,7 +31,7 @@
public class RPGInventoryPlugin extends TrackedPlugin {

private static final List<String> INTEREST_PLUGINS = Arrays.asList(
"ProtocolLib", "Vault", "BattleLevels", "Skills", "Heroes", "RacesAndClasses",
"ProtocolLib", "Vault", "Mimic", "BattleLevels", "Skills", "Heroes", "RacesAndClasses",
"SkillAPI", "MyPet", "RPGPlayerLeveling", "PlaceholderAPI", "MMOItems", "QuantumRPG",
"MMOCore", "MMOInventory"
);
Expand All @@ -42,11 +41,13 @@ public RPGInventoryPlugin() {
}

@Override
protected final @NotNull Reporter createReporter() {
String dsn = "@sentry_dsn@"; // Token will be replaced in compile time, so it can be empty
protected final Reporter createReporter() {
String dsn = "@sentry_dsn@";
// Token will be replaced in compile time, so it can be empty
// noinspection ConstantConditions
if (dsn.isEmpty()) {
Log.w("It is unofficial build of RPGInventory.");
dsn = "no_dsn";
return null;
}

return new SentryReporter.Builder()
Expand Down

0 comments on commit 580bc68

Please sign in to comment.