egulias / EmailValidator4J

Java RFC strict EmailValidator
MIT License
25 stars 8 forks source link

NPE in EmailLexer #19

Open will-sargent-eero opened 1 year ago

will-sargent-eero commented 1 year ago

https://github.com/egulias/EmailValidator4J/blob/master/src/main/java/emailvalidator4j/lexer/EmailLexer.java#L36

java.util.Objects in requireNonNull at line 209
java.util.Optional in of at line 113
emailvalidator4j.lexer.EmailLexer in lex at line 36
emailvalidator4j.parser.Email in parse at line 27
emailvalidator4j.EmailValidator in isValid at line 23

So the tokens is not empty, but tokens.get(0) is null -- this should probably be Optional.ofNullable.