diff --git a/AssetManager.Services/PortfolioService.cs b/AssetManager.Services/PortfolioService.cs index 05ecfca..aa2dc1a 100644 --- a/AssetManager.Services/PortfolioService.cs +++ b/AssetManager.Services/PortfolioService.cs @@ -198,7 +198,7 @@ public class PortfolioService : IPortfolioService throw new Exception("User not found"); } - string targetCurrency = user.DefaultCurrency ?? "CNY"; + string targetCurrency = !string.IsNullOrEmpty(user.DefaultCurrency) ? user.DefaultCurrency : "CNY"; _logger.LogInformation("用户 {UserId} 默认本位币: {Currency}", userId, targetCurrency); decimal totalValueInTargetCurrency = 0; decimal totalCostInTargetCurrency = 0;