Skip to content

Commit

Permalink
Merge 33ff7be into 8d97c51
Browse files Browse the repository at this point in the history
  • Loading branch information
wetneb committed Jul 3, 2019
2 parents 8d97c51 + 33ff7be commit d3798ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ public int compare(ReconResult a, ReconResult b) {
* the cell value to compare the reconciliation data to
*/
public void computeFeatures(Recon recon, String text) {
if (recon.candidates != null && !recon.candidates.isEmpty()) {
if (recon.candidates != null && !recon.candidates.isEmpty() && text != null) {
ReconCandidate candidate = recon.candidates.get(0);

recon.setFeature(Recon.Feature_nameMatch, text.equalsIgnoreCase(candidate.name));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,4 +345,15 @@ public void testComputeFeatures() {
stub.computeFeatures(recon, "my string");
assertNotNull(recon.features);
}

/**
* Should not happen, but added for extra safety
*/
@Test
public void testComputeFeaturesNullText() {
StandardReconConfigStub stub = new StandardReconConfigStub();
Recon recon = stub.createNewRecon(2384738L);
stub.computeFeatures(recon, null);
assertNotNull(recon.features);
}
}

0 comments on commit d3798ce

Please sign in to comment.