diff --git a/RMuseum/Services/Implementation/RecitationService.cs b/RMuseum/Services/Implementation/RecitationService.cs index e7ea7bc4..6c23128a 100644 --- a/RMuseum/Services/Implementation/RecitationService.cs +++ b/RMuseum/Services/Implementation/RecitationService.cs @@ -1410,7 +1410,10 @@ namespace RMuseum.Services.Implementationa { try { - return new RServiceResult(new UserRecitationProfileViewModel(await _context.UserRecitationProfiles.Include(p => p.User).Where(p => p.UserId == userId && p.IsDefault == true).FirstOrDefaultAsync())); + var defProfile = await _context.UserRecitationProfiles.Include(p => p.User).Where(p => p.UserId == userId && p.IsDefault == true).FirstOrDefaultAsync(); + if (defProfile == null) + return new RServiceResult(null); + return new RServiceResult(new UserRecitationProfileViewModel(defProfile)); } catch (Exception exp) {