Hi there,

I've got an NPE when performing a <emailStoreMessageId> on a box that contains a message for which getSubject returns null. I didn't examine that message to know why it is possible, but what I see in the doMatch() method in AbstractSelectStep seems weird to me

static boolean doMatch(final String expected, final String actual) {
       // semantics are: if no expectation then match
       if (StringUtils.isEmpty(expected)) {
           return true;
       }
        // if actual is null, you're sure to get a NPE
       if (isRegexMatch(expected)) {
return getVerifier(true).verifyStrings(expected.substring(1, expected.length() - 1), actual);
       }
       return getVerifier(false).verifyStrings(expected, actual);
   }

It may be a development choice, but if we have
// semantics are: if no expectation then match
couldn't we have
// semantics are: if no actual then no match
with this kind of code
       if (StringUtils.isEmpty(actual)){
           return false;
       }

Someone can tell me if I'm wrong?

Cheers

Florent

--
Pingwy
27, rue des arènes
49100 Angers

Reply via email to