From 1cf7e2f5d2ed158ac66398efa2a6f42a59afc625 Mon Sep 17 00:00:00 2001 From: Tad Tarrant <69368213+crowbarmaster@users.noreply.github.com> Date: Sat, 10 Feb 2024 20:20:44 -0500 Subject: [PATCH] Dividing by zero can't happen. --- MinecraftService/Service/Server/BedrockBackupManager.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/MinecraftService/Service/Server/BedrockBackupManager.cs b/MinecraftService/Service/Server/BedrockBackupManager.cs index 70bfb90..921e759 100644 --- a/MinecraftService/Service/Server/BedrockBackupManager.cs +++ b/MinecraftService/Service/Server/BedrockBackupManager.cs @@ -69,8 +69,11 @@ public virtual bool PerformBackup(string queryString) { int currentFileCount = 0; foreach (FileInfo levelFile in levelFiles) { currentFileCount++; - if(currentFileCount % progressCallCount == 0) { - _logger.AppendLine($"Adding files to archive. {currentFileCount / 6}% complete..."); + try { + if (progressCallCount != 0 && currentFileCount % progressCallCount == 0) { + _logger.AppendLine($"Adding files to archive. {currentFileCount / 6}% complete..."); + } + } catch { } backupZip.CreateEntryFromFile(levelFile.FullName, $"{_serverConfiguration.GetProp(MmsDependServerPropKeys.LevelName)}/{levelFile.Name}"); }