RandomData icon indicating copy to clipboard operation
RandomData copied to clipboard

Possible NPE in DateGenerator

Open Anvell opened this issue 5 years ago • 0 comments

Hello, the DateGenerator class would benefit from additional null check:

    @Override
    protected Matcher getDefaultMatcher() {
        return f -> f.getName().equals("date");
    }

to

    @Override
    protected Matcher getDefaultMatcher() {
        return f -> f.getName() != null && f.getName().contains("date");
    }

Currently it would crash when no RandomValue annotation is provided to some of the fields or default values are supplied in a data class constructor.

Anvell avatar Apr 02 '20 10:04 Anvell