added checks

This commit is contained in:
Nicolas Constant 2022-12-28 18:21:10 -05:00
parent e950801f56
commit 21ff67e3a8
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
1 changed files with 6 additions and 6 deletions

View File

@ -176,9 +176,9 @@ namespace BirdsiteLive.Controllers
{
//Verify can be migrated
var twitterAccount = await _twitterUserDal.GetTwitterUserAsync(id);
if (twitterAccount.Deleted
if (twitterAccount != null && (twitterAccount.Deleted
|| !string.IsNullOrWhiteSpace(twitterAccount.MovedTo)
|| !string.IsNullOrWhiteSpace(twitterAccount.MovedToAcct))
|| !string.IsNullOrWhiteSpace(twitterAccount.MovedToAcct)))
return Ok();
// Start migration
@ -200,7 +200,7 @@ namespace BirdsiteLive.Controllers
{
//Verify can be deleted
var twitterAccount = await _twitterUserDal.GetTwitterUserAsync(id);
if (twitterAccount.Deleted) return Ok();
if (twitterAccount != null && twitterAccount.Deleted) return Ok();
// Start deletion
var isTweetValid = _migrationService.ValidateTweet(id, tweetid, MigrationTypeEnum.Deletion);