1
0
mirror of https://github.com/bitwarden/server synced 2026-01-03 00:53:37 +00:00

Fixed null reference to device when loggin in for website

This commit is contained in:
Kyle Spearrin
2016-07-23 17:12:42 -04:00
parent d300c82ffd
commit 4a8162d09a
2 changed files with 19 additions and 15 deletions

View File

@@ -111,11 +111,14 @@ namespace Bit.Core.Identity
success.Token = token;
success.User = user;
var existingDevice = await _deviceRepository.GetByIdentifierAsync(device.Identifier, user.Id);
if(existingDevice == null)
if(device != null)
{
device.UserId = user.Id;
await _deviceRepository.CreateAsync(device);
var existingDevice = await _deviceRepository.GetByIdentifierAsync(device.Identifier, user.Id);
if(existingDevice == null)
{
device.UserId = user.Id;
await _deviceRepository.CreateAsync(device);
}
}
return success;