Skip to content

Commit

Permalink
Fix checking for null on an empty array (#1231)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKevJoy authored Mar 8, 2024
1 parent 3e1b761 commit 8ef961a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public async Task<CreateTeacherResult> CreateTeacher(CreateTeacherCommand comman
helper.FlagBadData(txnRequest);

var findExistingTeacherResult = await (findExistingTeacher ?? helper.FindExistingTeacher)();
var allocateTrn = findExistingTeacherResult == null;
var allocateTrn = findExistingTeacherResult.Length > 0;
string trn = null;

if (allocateTrn)
Expand Down Expand Up @@ -366,7 +366,7 @@ public async Task<CreateTeacherDuplicateTeacherResult[]> FindExistingTeacher()
else
{
// Not enough data in the input to match on
return null;
return Array.Empty<CreateTeacherDuplicateTeacherResult>();
}

var query = new QueryExpression(Contact.EntityLogicalName)
Expand Down

0 comments on commit 8ef961a

Please sign in to comment.