From 9c8ab71736fbee44baa00d4a398743bcd9843bf0 Mon Sep 17 00:00:00 2001 From: cryptooda Date: Sat, 22 Nov 2025 16:32:00 +0700 Subject: [PATCH] Do not update the masterBotUserId if update change it to null --- .../PostgreSql/PostgreSqlBotRepository.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Managing.Infrastructure.Database/PostgreSql/PostgreSqlBotRepository.cs b/src/Managing.Infrastructure.Database/PostgreSql/PostgreSqlBotRepository.cs index a7960d0f..ea224640 100644 --- a/src/Managing.Infrastructure.Database/PostgreSql/PostgreSqlBotRepository.cs +++ b/src/Managing.Infrastructure.Database/PostgreSql/PostgreSqlBotRepository.cs @@ -80,7 +80,8 @@ public class PostgreSqlBotRepository : IBotRepository existingEntity.LastStartTime = bot.LastStartTime; existingEntity.LastStopTime = bot.LastStopTime; existingEntity.AccumulatedRunTimeSeconds = bot.AccumulatedRunTimeSeconds; - existingEntity.MasterBotUserId = bot.MasterBotUserId; + existingEntity.MasterBotUserId = + bot.MasterBotUserId ?? existingEntity.MasterBotUserId; await _context.SaveChangesAsync().ConfigureAwait(false); }