Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IsIterableContainingInOrder.contains(null, null) causes NullPointerException #69

Closed
izat opened this issue Oct 31, 2014 · 0 comments
Closed

Comments

@izat
Copy link

izat commented Oct 31, 2014

It just looks like the same exception as issue 25.

code:

    @Test
    public void testHamcrest() throws Exception {
        List<Integer> list = Arrays.asList(null, null);
        assertThat(list, IsIterableContainingInOrder.contains(null, null));
    }

output:

java.lang.NullPointerException
    at org.hamcrest.collection.IsIterableContainingInOrder$MatchSeries.isMatched(IsIterableContainingInOrder.java:65)
    at org.hamcrest.collection.IsIterableContainingInOrder$MatchSeries.matches(IsIterableContainingInOrder.java:52)
    at org.hamcrest.collection.IsIterableContainingInOrder.matchesSafely(IsIterableContainingInOrder.java:25)
    at org.hamcrest.collection.IsIterableContainingInOrder.matchesSafely(IsIterableContainingInOrder.java:14)
    at org.hamcrest.TypeSafeDiagnosingMatcher.matches(TypeSafeDiagnosingMatcher.java:55)
    at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:12)
    at org.junit.Assert.assertThat(Assert.java:865)
    at org.junit.Assert.assertThat(Assert.java:832)
npathai added a commit to npathai/JavaHamcrest that referenced this issue Nov 2, 2014
npryce added a commit that referenced this issue Nov 23, 2014
Fixed Issue #69 by adding null safe check similar to the one in issue #25
@npryce npryce closed this as completed Nov 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants