optimize tags init

This commit is contained in:
易磊 2024-10-22 09:19:27 +08:00 committed by GitHub
parent 15ce459971
commit ad0b6bb6f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,7 +10,7 @@ namespace BotSharp.Core.Repository
var utcNow = DateTime.UtcNow;
conversation.CreatedTime = utcNow;
conversation.UpdatedTime = utcNow;
conversation.Tags = conversation.Tags ?? new();
conversation.Tags ??= new();
var dir = Path.Combine(_dbSettings.FileRepository, _conversationSettings.DataDir, conversation.Id);
if (!Directory.Exists(dir))