From a101ce915bb98be6ce7d3b54135d40610e15441e Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Fri, 29 Jan 2016 20:22:15 +0100 Subject: [PATCH] Don't print warning messages if backup on start/stop is disabled. --- src/main/java/fr/xephi/authme/PerformBackup.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/fr/xephi/authme/PerformBackup.java b/src/main/java/fr/xephi/authme/PerformBackup.java index 6dbb7e4f9..01f246a84 100644 --- a/src/main/java/fr/xephi/authme/PerformBackup.java +++ b/src/main/java/fr/xephi/authme/PerformBackup.java @@ -38,9 +38,16 @@ public class PerformBackup { * @param cause BackupCause The cause of the backup. */ public void doBackup(BackupCause cause) { + + // Do nothing if backup is disabled if (!Settings.isBackupActivated) { - ConsoleLogger.showError("Can't perform a Backup: disabled in configuration. Cause of the Backup: " + cause.name()); + // Print a warning if the backup was requested via command or by another plugin + if (cause == BackupCause.COMMAND || cause == BackupCause.OTHER) { + ConsoleLogger.showError("Can't perform a Backup: disabled in configuration. Cause of the Backup: " + cause.name()); + } + return; } + // Check whether a backup should be made at the specified point in time switch (cause) { case START: