api: handle subscription fetch errors

This commit is contained in:
Abdullah Atta
2025-10-07 16:41:18 +05:00
committed by Abdullah Atta
parent 72e825a12c
commit 2b6a58ff04
2 changed files with 2 additions and 2 deletions

View File

@@ -118,7 +118,7 @@ namespace Notesnook.API.Services
else
{
var subscriptionService = await WampServers.SubscriptionServer.GetServiceAsync<IUserSubscriptionService>(SubscriptionServerTopics.UserSubscriptionServiceTopic);
subscription = await subscriptionService.GetUserSubscriptionAsync(Clients.Notesnook.Id, userId);
subscription = await subscriptionService.GetUserSubscriptionAsync(Clients.Notesnook.Id, userId) ?? throw new Exception("User subscription not found.");
}
var userSettings = await Repositories.UsersSettings.FindOneAsync((u) => u.UserId == user.UserId) ?? throw new Exception("User settings not found.");