diff --git a/Notesnook.API/Services/S3Service.cs b/Notesnook.API/Services/S3Service.cs index a4619b1..d940d1b 100644 --- a/Notesnook.API/Services/S3Service.cs +++ b/Notesnook.API/Services/S3Service.cs @@ -230,7 +230,7 @@ namespace Notesnook.API.Services if (userId == null || objectName == null) throw new Exception("Could not abort multipart upload."); var subscriptionService = await WampServers.SubscriptionServer.GetServiceAsync(SubscriptionServerTopics.UserSubscriptionServiceTopic); - var subscription = await subscriptionService.GetUserSubscriptionAsync(Clients.Notesnook.Id, userId); + var subscription = await subscriptionService.GetUserSubscriptionAsync(Clients.Notesnook.Id, userId) ?? throw new Exception("User subscription not found."); long fileSize = await GetMultipartUploadSizeAsync(userId, uploadRequest.Key, uploadRequest.UploadId); if (StorageHelper.IsFileSizeExceeded(subscription, fileSize)) diff --git a/Notesnook.API/Services/UserService.cs b/Notesnook.API/Services/UserService.cs index cc853b8..54f311b 100644 --- a/Notesnook.API/Services/UserService.cs +++ b/Notesnook.API/Services/UserService.cs @@ -118,7 +118,7 @@ namespace Notesnook.API.Services else { var subscriptionService = await WampServers.SubscriptionServer.GetServiceAsync(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.");