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

"Christma-eve" before 2000 throws NPE #263

Open
simonwibberley opened this issue Feb 27, 2019 · 0 comments
Open

"Christma-eve" before 2000 throws NPE #263

simonwibberley opened this issue Feb 27, 2019 · 0 comments

Comments

@simonwibberley
Copy link

Thanks for a brilliant library, works almost perfectly :) thanks!

However, "Christmas-eve" fails with reference years before 2000 (2000+ works).

Parser parser = new Parser();
        List<DateGroup> dateGroups = parser.parse("Christmas-eve", new Date(LocalDateTime.of(1999, 3, 1, 0, 0, 0).toInstant(ZoneOffset.UTC).toEpochMilli()));
        if(dateGroups.size() == 1) {
            List<Date> parsed = dateGroups.get(0).getDates();
            if(parsed.size() == 1) {
                System.out.println(parsed.get(0));
            }
        }

Stack trace:

Exception in thread "main" java.lang.NullPointerException
	at java.util.Date.getMillisOf(Date.java:958)
	at java.util.Date.after(Date.java:931)
	at com.joestelmach.natty.WalkerState.seekToIcsEvent(WalkerState.java:571)
	at com.joestelmach.natty.WalkerState.seekToHoliday(WalkerState.java:393)
	at com.joestelmach.natty.generated.DateWalker.seek(DateWalker.java:1376)
	at com.joestelmach.natty.generated.DateWalker.relative_date(DateWalker.java:713)
	at com.joestelmach.natty.generated.DateWalker.date(DateWalker.java:659)
	at com.joestelmach.natty.generated.DateWalker.date_time(DateWalker.java:585)
	at com.joestelmach.natty.generated.DateWalker.date_time_alternative(DateWalker.java:532)
	at com.joestelmach.natty.generated.DateWalker.parse(DateWalker.java:418)
	at com.joestelmach.natty.Parser.singleParse(Parser.java:220)
	at com.joestelmach.natty.Parser.parse(Parser.java:112)
	at uk.ac.susx.tag.method51.text.pipeline.DateParser.main(DateParser.java:117)
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

1 participant