mirror of
https://github.com/streetwriters/notesnook-sync-server.git
synced 2026-03-30 07:51:15 +02:00
global: add null safety checks
This commit is contained in:
@@ -44,7 +44,7 @@ namespace Notesnook.API.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
var userId = this.User.FindFirstValue("sub") ?? throw new Exception("User not found.");
|
||||
var userId = this.User.GetUserId();
|
||||
new SyncDeviceService(new SyncDevice(userId, deviceId)).RegisterDevice();
|
||||
return Ok();
|
||||
}
|
||||
@@ -61,7 +61,7 @@ namespace Notesnook.API.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
var userId = this.User.FindFirstValue("sub") ?? throw new Exception("User not found.");
|
||||
var userId = this.User.GetUserId();
|
||||
new SyncDeviceService(new SyncDevice(userId, deviceId)).UnregisterDevice();
|
||||
return Ok();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user